Need assistance with REST API/curl

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.

2 answers

1 accepted

1 votes
Volodymyr Krupach Community Champion Feb 25, 2015

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?

0 votes
Volodymyr Krupach Community Champion Feb 26, 2015

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.

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

2,870 views 12 18
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot