in notifier.py [0:0]
def jira_update_ticket(self, ticket, txt, worklog=False):
"""Post JIRA comment or worklog entry"""
where = "comment"
data = {"body": txt}
if worklog:
where = "worklog"
data = {"timeSpent": "10m", "comment": txt}
rv = requests.post(
"https://issues.apache.org/jira/rest/api/latest/issue/%s/%s" % (ticket, where),
headers=JIRA_HEADERS,
auth=JIRA_AUTH,
json=data,
)
if rv.status_code == 200 or rv.status_code == 201:
return "Updated JIRA Ticket %s" % ticket
else:
raise Exception(rv.text)