Search code examples
jira-rest-apijira-agilejira-rest-java-api

Get Mandatory Transition Fields Jira Rest Java Client


I want to get the Fields necessary for a particular issue to make a transition from Open to Resolved and Resolved to Closed. Any ideas on how to move forward with this ?

All I see of the internet are examples of adding custom fields.


Solution

  • To perform a transition in JIRA, making use of the rest APIs

    1. you need to GET the transition id from https:///rest/api/2/issue//transitions?expand=transitions.fields"
    2. From the response, you can find the possible transitions for the issue, corresponding transition ids and the fields(with required flag) for each transition.
    3. You can generate a request JSON from above response and POST to https:///rest/api/2/issue//transitions

    To do multiple transitions, need to come up with some logic, by getting issue status each time in a loop and performing transitions based on the response.

    This is very high level, hope this helps