I have figured out everything I need with curl through REST API except how to 'Start Progress' on a main or sub-task ticket, and similarly how to 'Close' same. I can create and update and resolve and assign to tickets, but just can't seem to get one to 'Start Progress' nor 'Close'. Any help appreciated.
Hi Jesse!
You need to use /issue/{issueIdOrKey}/transitions POST: https://docs.atlassian.com/jira/REST/latest/#d2e387 passing the id of transition:
{ "transition": { "id": "5" } }
Use /issue/{issueIdOrKey}/transitions GET to get possible transition and their ids:
Can you give me some specific code for "Start Progress" specifically, and for "Close" ticket?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jesse!
Posting as new answer so I can use formatting.
1) "Start Progress" and "Close" are transitions. Depending on current issue status and issue type (each issue type can be assigned to use specific workflow scheme), a specific issue can have different transitions. That's why first thing we make REST call to rest/api/2/issue/MWC-1/transitions where MWC-1 is issue key you want to start or close. MWC-1 was in "TO-DO" status (i.e. not started yet) so in response I get JSON with 3 transitions that are possible for "TO-DO" status:
{ "expand":"transitions", "transitions":[ { "id":"11", "name":"Start Progress", "to":{ "self":"https://vkrupach.atlassian.net/rest/api/2/status/3", "description":"This issue is being actively worked on at the moment by the assignee.", "iconUrl":"https://vkrupach.atlassian.net/images/icons/statuses/inprogress.png", "name":"In Progress", "id":"3", "statusCategory":{ "self":"https://vkrupach.atlassian.net/rest/api/2/statuscategory/4", "id":4, "key":"indeterminate", "colorName":"yellow", "name":"In Progress" } } }, { "id":"21", "name":"Done", "to":{ "self":"https://vkrupach.atlassian.net/rest/api/2/status/10000", "description":"", "iconUrl":"https://vkrupach.atlassian.net/images/icons/statuses/closed.png", "name":"Done", "id":"10000", "statusCategory":{ "self":"https://vkrupach.atlassian.net/rest/api/2/statuscategory/3", "id":3, "key":"done", "colorName":"green", "name":"Done" } } }, { "id":"131", "name":"Start Review", "to":{ "self":"https://vkrupach.atlassian.net/rest/api/2/status/10001", "description":"", "iconUrl":"https://vkrupach.atlassian.net/images/icons/statuses/information.png", "name":"In Review", "id":"10001", "statusCategory":{ "self":"https://vkrupach.atlassian.net/rest/api/2/statuscategory/1", "id":1, "key":"undefined", "colorName":"medium-gray", "name":"No Category" } } } ] }
2) Let's assume that we want to Start the MWC-1. From the previous JSON we see that id for Start Progress transitions is 11 so we make POST call to rest/api/2/issue/MWC-1/transitions passing the JSON in the body:
{ "transition": { "id": "11" } }
The same way your close an issue: When the issue is in status that has transition to Close, you make the REST to get the id of the Close transition, then you make the POST passing the id.
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.