I am struggling to get automation working that will close a set of tickets that are in on status and need to move to closed. I have searched for similar solutions/problems and attempted all that i have read - to no avail. So I am asking for some help.
i have tried a couple of ways - the first and most straight forward looked like the followoing API (ticket has the ticket number in it).
jira.set_issue_status( ticket, "Closed", {'resolution': {'name': 'Fixed'}} )
I got back a:
400 Client Error: Bad Request for url: https://........atlassian.net/rest/api/2/issue/<ticket>/transitions
I also tried not passing in the fields value and got the same response.
Watching others - i then did:
jira.get_issue_transitions(ticket) - to get the list of transitions
transitions:
[ {'id': 11, 'name': 'In Progress', 'to': 'In Dev'},
{'id': 41, 'name': 'In QA', 'to': 'In QA'},
{'id': 81, 'name': 'Open', 'to': 'Open'},
{'id': 91, 'name': 'Ready For QA', 'to': 'Ready For QA'},
{'id': 191, 'name': 'Development Ready', 'to': 'Development Ready'},
{'id': 31, 'name': 'Close', 'to': 'Closed'}]
OR
transition_id_to_status_name(ticket, "Closed") - to find the transition_id that would cause this change.
Result: transition_id: 31
and attempted
jira.set_issue_status_by_transition_id(ticket, "31") -- the ID to get to close
OR
jira.set_issue_status( ticket, "Closed")
All returning "400 Client Error: Bad Request for url"
I am stumped - any help is appreciated.