Skip to content

Instantly share code, notes, and snippets.

@danielbloom
Last active August 16, 2018 02:06
Show Gist options
  • Save danielbloom/bbe5831c0b0971f1cc02f434c7bc2e26 to your computer and use it in GitHub Desktop.
Save danielbloom/bbe5831c0b0971f1cc02f434c7bc2e26 to your computer and use it in GitHub Desktop.
Get Jira data via API
def get_jira_assigments():
"""
Gets data from Jira API and builds list of tickets by assignee
"""
username = os.environ['JIRA_USERNAME']
password = os.environ['JIRA_PASSWORD']
params = {
"jql": 'status in ("IN PROGRESS", "CODE REVIEW") AND assignee != Unassigned',
"startAt": 0,
"maxResults": 100,
"fields": [],
"expand": [],
"validateQuery": "true"
}
headers = {
'Content-Type': 'application/json',
'Accept': '*/*'
}
assignments = {}
count = 0
while True:
params['startAt'] = count
response = requests.post(JIRA_API_URI, auth=(username, password), data=json.dumps(params), headers=headers)
jira_data = response.json()
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment