Skip to content

Conversation

@trapeze-bell-peter
Copy link
Contributor

I found two issues when trying to use jira-ruby to transition an issue:

  1. The example provided in the example.rb file does not work. What one needs
    is a list of available transitions given the current state of the JIRA. issue.transitions.all does this. It provides an array that
    one can then look through to find the appropriate Id of the transition one wants to make.

  2. Transition was using the default Base#save. However this does not generate the correct URL. It generates a URL in the form PUT https://jira-hostt/rest/api/2/issue/13322/transitions/34 with a JSON payload. What JIRA requires is a URL of the form: POST https://jira-hostt/rest/api/2/issue/13322/transitions with the correct JSON payload. This commit fixes this issue.

peterbell215 and others added 3 commits June 20, 2020 10:31
Updating master from sumoheavy
Was using Grasshopper.  Switched to using the newer agile API.  Ran all RSpecs and they pass.  Does away with the need to query rapidView.
I found two issues when trying to use jira-ruby to transition an issue:

1)  The example provided in the example.rb file does not work.  What one needs
is a list of available transitions given the current state of the JIRA.  issue.transitions.all does this.  It provides an array that
one can then look through to find the appropriate Id of the transition one wants to make.

2) Transition was using the default Base#save.  However this does not generate the correct URL.  It generates a URL in the form PUT  https://jira-hostt/rest/api/2/issue/13322/transitions/34 with a JSON payload.  What JIRA requires  is a URL of the form: POST https://jira-hostt/rest/api/2/issue/13322/transitions with the correct JSON payload.   This commit fixes this issue.
@SimonMiaou
Copy link
Contributor

Hi @trapeze-bell-peter ,
Thank you for the PR!

Unfortunately I am not familiar with this part of the JIRA API and would love to have some external reviews and/or people testing it.

Could you also look into having tests for this change?

@trapeze-bell-peter
Copy link
Contributor Author

Will add some tests and would welcome review.

@trapeze-bell-peter
Copy link
Contributor Author

Just wanted to say sorry for not yet sorting out the tests. Been very busy. Hope to get to it this weekend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants