Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Jira API - which Java class contains the constants for Status and Transitions?

Ramkumar Krishnan
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 26, 2023

This is a follow-up to this Solved thread: https://community.atlassian.com/t5/Jira-Service-Management/How-to-change-the-status-of-a-Jira-ticket-from-OPEN-to-Under/qaq-p/1514306

Which com.atlassian.jira class contains the constant declarations for Status values and Transition values?

To clarify, I want to avoid declaring local variables like this:

public final String RESOLVE_TRANSITION = "Resolved";
private static final int RESOLVE_TRANSITION_ID = 201;
but instead use the named constants provided from the Jira API class (to insulate myself from any future changes or deprecation). The question is: what class should I import in my Java code to get these constants?

Thanks

1 answer

0 votes
Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 26, 2023

Welcome to the Atlassian Community!

The short answer is that "you don't". 

Workflows are variable.  As soon as anyone edits a workflow (and one of Jira's greatest powers is that you can), you have a change that you can't guess reliably that has moved away from the defaults.

There are no things like "RESOLVE_TRANSITION" or "RESOLVE_TRANSITION_ID", and even if they were, I can absolutely guarantee you that you have different values for them in your system, let alone looking wider.

There are no constants for status or transitions.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events