Skip to content

Instantly share code, notes, and snippets.

@andybak
Created February 3, 2014 14:42
Show Gist options
  • Save andybak/8784990 to your computer and use it in GitHub Desktop.
Save andybak/8784990 to your computer and use it in GitHub Desktop.
# Requires https://github.com/andybak/codebase-python-api-client.git
import csv
from codebase.client import CodeBaseAPI
codebase = CodeBaseAPI(username='account name/user name', apikey='your key here', project='project name')
tickets = [codebase.ticket(ticket_id=x) for x in range(1,151)]
f = open('tickets.csv', 'wb')
tickets = [x['ticket'] for x in tickets if x.get('ticket')]
keys = tickets[0].keys()
dict_writer = csv.DictWriter(f, keys)
dict_writer.writer.writerow(keys)
dict_writer.writerows(t)
f.close()
@andybak
Copy link
Author

andybak commented Feb 3, 2014

I hardcoded in the range of ticket ID's on line 7. Need to figure out how to get that from the API

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment