Last active
August 16, 2018 02:06
-
-
Save danielbloom/bbe5831c0b0971f1cc02f434c7bc2e26 to your computer and use it in GitHub Desktop.
Get Jira data via API
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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