1

I am trying close all the JIRA tickets on post-receive hook. My python script is executing on post-receive, from commit message I am able to get JIRA ticket number and found the ticket in JIRA also.

All it is working fine but when I want to change status of JIRA ticket with below code getting error 400 bad request response from JIRA server.

jira.transition(issue,'31')

also tried giving 500 internal server error.

jira.transition_issue(issue, '5', assignee={'name': 'pm_user'}, resolution={'id': '3'})

Please help me how to change the status of the ticket. Authentication with JIRA and finding ticket with

issue = jira.issue(issuekey)

is also successful but unable to change the ticket status to "Done".

Pavan
  • 21
  • 4
  • As a side note, isn't this risky. you might commit an incomplete resolution but still close the ticket. "To review" would seems more appropriate to me. – AxelH Mar 22 '18 at 06:27

1 Answers1

0

"500 internal server error" means an error on the server side, and your Jira admin can give you some clues by fetching the error message.

Check this thread to see if the solution applies:

Here's the python solution, which is what I'm working with. The transition IDs are part of the Workflow view, but not everyone can see those IDs. In my case I can see the graph but JIRA doesn't actually display what the IDs are in order to make it work.

You'll note that for the start of each section is an id and a number. Those are the numbers that you need and they CAN be different so you'll want to look at an issue in every one of the states and dump out their transitions to see what the ids are.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • I did not get anything from that thread. Changed to all the transitionId's but still getting the same. Can you please tell me for what each parameter is for in below code (issue, '5', assignee={'name': 'pm_user'}, resolution={'id': '3'}) – Pavan Mar 22 '18 at 13:54
  • @Pavan First, did you get the logs associated with the 500 internal server error? – VonC Mar 22 '18 at 13:55
  • No. Trying for that. – Pavan Mar 22 '18 at 13:57
  • What did you see in the logs, which helped you resolve the issue? – VonC Apr 11 '18 at 15:57