Jira Transition Status ID will be uniform across all projects in JIRA

Hi All,

   In relation to below question : https://answers.atlassian.com/questions/83519/updating-an-issue-s-status-via-the-rest-api .

 

I have below question on the same. i.e   

 While doing transition using rest api mentioned in the link will the ID to be transformed be uniform across different projects under JIRA. i.e. For example will mappings like below provided be same for all JIRA Issues across all projects. 

id 141 for Closed , id 131 for Accepted like that?. 

Please share your thoughts on the same. Thanks

1 answer

1 accepted

1 vote

It depends.

The id of a transition is part of a workflow.

If your issues are configured to use the same workflow, then of course the transition will have the same ID, because it's the same workflow.  If they're using different workflows, then no.  (If you've copied workflows, similar transitions might have the same id, but you can not assume that - two workflows are likely to have different transition ids, even if they look pretty much the same)

Thank a lot for the answer. So first we have to identify possible transitions associated to an issue using  API GET /rest/api/2/issue/{issueIdOrKey}/transitions and then make call to transition change API based on those ID values. Is my understanding correct?

Yes, you need to look up what is available, as the id is variable.

Hi Nic,

   Thanks for your help in understanding transition. One more clarification related to that I would like to inquire. Please share your thoughts on the same.

    My Requirement is to update a Jira Issue (different project can exist) to the "Close" status via Rest API. i.e I want to implicitly change it's status to that of "Close" so that portal user will get to know that it is no longer needed to be worked up on.

    But what I infer from your answer is that for each project they can define their own workflows and chances are there where they haven't configured a workflow equivalent to that of "Close". 

    Is my understanding correct? If so, is there a way we can know the transitions final workflow so that if "close" is not present I can set to that final workflow status.

Please let me know if my question is ambiguous to you. Thanks in advance.

Correct.  You will need to read the workflow yourself to work out what the end states might be.

It's perfectly possible for a human to write a workflow that looks like "Badger -> Mushroom -> Snake".  This example shows you a number of problems:

  • As another human, you'll probably be able to work out what the end state might be, or simply ask the writer what they want, but a computer cannot do either of those, it needs you to tell it.
  • You could try looking at the category (or colour) of each status - it is very likely that an end-status will be a green "done" one, whereas open or in-progress ones will not be. 
  • The number of green status in a workflow could be zero, one or many.  If it's one, you can probably assume that's an end state.  But if it's zero or more than one, you will need to look at it.
  • You also need to think about cases where a human sets up a linear workflow.  In my example, you can't transition from Badger to Snake, so you'll need to transition twice to get to the end state.
  • A project can have many workflows
  • There can be conditions on workflows that prevent simple pushes


In short - you will need to read your workflows.  You have to understand what you're coding for.

Thanks a lot for the detailed explanation.

Suggest an answer

Log in or Join to answer
Community showcase
Emilee Spencer
Published Friday in Marketplace Apps

Marketplace Spotlight: DeepAffects

Hello Atlassian Community! My name is Emilee, and I’m a Product Marketing Manager for the Marketplace team. Starting with this post, I'm kicking off a monthly series of Spotlights to highlight Ma...

51 views 0 3
Read article

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