Forums

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

How to get all Status in jira using java API?

Ramesh Lakshmanasamy June 29, 2018

I need to get all statuses using Java API.

1 answer

1 vote
Tansu Akdeniz
Community Champion
June 29, 2018

Hi @Ramesh Lakshmanasamy,

You can use ConstantsManager.

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.config.ConstantsManager;
import com.atlassian.jira.issue.status.Status;

ConstantsManager constantsManager = ComponentAccessor.getConstantsManager();
Collection<Status> statuses = constantsManager.getStatuses();

Tansu

Ramesh Lakshmanasamy June 29, 2018

I need to get StatusID and StatusName @Tansu Akdeniz.When i loop using collection object i cant get status name and Id.

Tansu Akdeniz
Community Champion
June 29, 2018

You can take id, name etc values inside the loop.

for(status in statuses){
    println "Status Name: " +status.getName();
    println "Status Id: " +status.getId();
}
Ramesh Lakshmanasamy July 6, 2018

Thanks @Tansu Akdeniz

Tansu Akdeniz
Community Champion
July 8, 2018

You are welcome @Ramesh LakshmanasamyIf my answer helped to solve your question, would you please accept it. So that, other people will be able to find this answer easily for similar questions.

Ramesh Lakshmanasamy July 8, 2018

sure

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events