Hi Guys,
I'm struggling to change the status for a ticket using the REST-API.
I thought I needed to find the ID from the Issue key, and I do find an ID, but not the ID apparently needed to change the status.
I could be doing something dumb here, but any help would be appreciated.
Step 1: Find the Ticket
Hi,
Welcome to the community
your link's variable should be something like this:
<yourJiraInstance>/rest/raven/1.0/api/testrun/{id}/
then you need to create a json that you will attach to your request
https://docs.getxray.app/display/XRAY/Test+Runs+-+REST
https://requests.readthedocs.io/en/latest/user/quickstart/#more-complicated-post-requests
Are you referring to step 1 or step 2?
The issue is, I don't have the ID for step 1. I only have the key for the issue. When I tried to get the ID via Step 1, the ID is not valid in step 2.
The link you provided is also already what I have in step 2. In Step 1, if I try to use the testrun link instead with the key of the issue, I get a 404 Error.
The solution is either hopefully generic for all issue types, not just testrun, or it provides a way for me to get the proper ID.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you want to update a testrun and you doesn't know it's id you'll need to make a call to this API with the testExec and testIssueKey
http://yourserver/rest/raven/1.0/api/testrun?testExecIssueKey=TEST-123&testIssueKey=TEST-321
you will find the id of your test run and then you will be able to update it with this call
put ==> /rest/raven/1.0/api/testrun/{id}/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I also don't have the TestExec key. I only have the testrun key.
There is no generic way of changing the status? That is separate from whether it is a testrun, testexec or any other type?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Of course, you can do it by using the Jira api itself
https://docs.atlassian.com/software/jira/docs/api/REST/9.2.0/#api/2/issue-doTransition
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I actually don't find this page so helpful for transition. I don't see how I can change the status here. They don't have a key defined for status except under SCHEMA, but even under the SCHEMA tab I only see types being defined as "string" for anything to do with the status.
In short, I don't understand what my json data would look like in this case.
data = {???}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If data should just be:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I had found this ticket: https://community.atlassian.com/t5/Jira-questions/Cannot-transition-an-issue-via-Rest-API/qaq-p/1194157
But in doing the following, I get a 405 error:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You need to call this api:
GET /rest/api/2/issue/{issueIdOrKey}/transitions
It will give you all the information you need to make the transition then make the transition with the api below
POST /rest/api/2/issue/{issueIdOrKey}/transitions
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.