Code to get all the resolutions of issue in Jira

Suresh Basina June 16, 2016

Hi All,

 

I want to get all the resolutions related to issue in jira.

Please let us know the code to get all the resolutions related to issues in jira.

 

Thanks

Suresh

2 answers

1 vote
Petar Petrov (Appfire)
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.
June 16, 2016

In Java you can do this:

ComponentAccessor.getConstantsManager().getResolutionObjects();

This will return you all resolutions defined in the system - as mentioned in the other answer, they apply to all issues and are not specific to a project or issue type.

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 16, 2016

You don't need code.  Look at Admin -> Issues -> Resolutions.

Or just go visit an issue that is ready to be closed and has a resolution field on the close screen - the drop-down lists the options (although some people do customise that list, so the better option is the one above)

If that doesn't answer the question, you'll need to explain more.  Why do you need "all the resolutions" and what are you aiming to do with them?  And what code?  (internal, add-on, Connect, REST, something else?)

Suresh Basina June 16, 2016

Hi Nic,

Thanks for your reply. Through the UI I know, how to see all the resolutions.

But using JIRA API, I want to get all the resolutions of an issue, to display them in my plugin's page. And also, are the resolutions are common to all the issue types or specific to issue type.

If specific to issue type, may I know the code, to get all the resolutions specific to an issue type in project.

 

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 16, 2016

Resolutions are a global list.

>I want to get all the resolutions of an issue

That's nonsense, as an issue is either unresolved (no resolution) or resolved, with $issue.getResolution() returning the resolution.

Mahesh S
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.
June 16, 2016

It is not specific to issue type.

gfinesch August 1, 2018

Now that

(Collection<Resolution>) ComponentAccessor.getConstantsManager().getResolutionObjects();

is deprecated, What should I use to retrieve all Jira's Resolution Objects?

gfinesch August 3, 2018

Osp sorry I didn't notice there's getResolutions() right below in the API. Don't mind.

Suggest an answer

Log in or Sign up to answer