Skip to content

Instantly share code, notes, and snippets.

@adamjmcgrath
Last active August 29, 2015 14:05
Show Gist options
  • Save adamjmcgrath/c4a45717ac7684f5e40d to your computer and use it in GitHub Desktop.
Save adamjmcgrath/c4a45717ac7684f5e40d to your computer and use it in GitHub Desktop.
get_release_changelog.py
#!/usr/bin/env python
# Usage: get_release_changelog.py "Facebook v1.0"
import sys
import requests
USER = '' # Your email
SCRUMWISE_TOKEN = '' # Get from scrumwise settings
BASE_URL = 'https://api.scrumwise.com/service/api/v1/getData?includeProperties='
RELEASES_URL = '%sProject.releases' % BASE_URL
ITEMS_URL = '%sProject.backlogItems' % BASE_URL
def get_release_id_from_name():
try:
release_name = sys.argv[1]
except IndexError:
print 'Pass in a release name'
return
print 'looking for %s' % release_name
response = requests.get(RELEASES_URL, auth=requests.auth.HTTPBasicAuth(USER, SCRUMWISE_TOKEN))
for project in response.json()['result']['projects']:
for release in project['releases']:
if release['name'] == release_name:
return release['id']
def get_items_in_release(release_id):
print 'looking for items in %s' % release_id
response = requests.get(ITEMS_URL, auth=requests.auth.HTTPBasicAuth(USER, SCRUMWISE_TOKEN))
for project in response.json()['result']['projects']:
for item in project['backlogItems']:
if item['releaseID'] == release_id:
print '[Scrumwise#%d](http://scrumwise.com/scrum) %s ' % (item['itemNumber'], item['name'])
def main():
release_id = get_release_id_from_name()
print get_items_in_release(release_id)
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment