My team set up our workflow so JIRA tickets get automatically transitioned with Github: https://answers.atlassian.com/questions/156678. My scenario is that I want to automate (using jira-python) updating specific fields based on the 'development' information (i.e. if there were commits, pull requests or merged pull requests.. etc) for the tickets.
My specific questions are:
1) How can I query to find these issues?
2) How can I retrieve the development info associated with an issue (commits, PRs, merges, branch names used.. etc)
Community moderators have prevented the ability to post new answers.
This is not currently supported in the python JIRA module. To get this information, you'll have to do some hacky stuff. I did the following to get Pull Requests.
I hijacked the session from the module:
sess_get = jira._session.get
Then I crafted my own request for the particular detail I was trying to get at, in this case pull requests.
DEV_STATUS = 'https://myorg.atlassian.net/rest/dev-status/1.0' _issue = 'issue/detail?issueID=%s' % issue.id _args = 'applicationType=github&dataType=pullrequest&_=%s' % int(time.time()) req_url = '%s/%s&%s' % (DEV_STATUS, _issue, _args) response = sess_get(req_url) raw_data = json.loads(response.content) for req in raw_data['detail']['pullRequests']: print('%s\n%s\n\n' % (req['name'], req['url']))
I hope that helps!
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events