Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix transition issue #358

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

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
Collaborator

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