Forums

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

JIRA - Issue fields

b
Contributor
April 9, 2012

Hi,

I want to get Issue field controls. For example like: priority, status or type. How would I do that? Any code examples?

4 answers

1 accepted

1 vote
Answer accepted
Radu Dumitriu
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.
April 10, 2012

Ok. As always, a good answer depends on the question.

Priority (all):

ComponentManager.getComponentInstanceOfType(ConstantsManager.class).getPriorityObjects()

Issue type (all):

ComponentManager.getComponentInstanceOfType(ConstantsManager.class).getAllIssueTypeObjects()

but: issue types depends on the project (actually scheme), so:

ComponentManager.getComponentInstanceOfType(IssueTypeSchemeManager.class).getIssueTypesForProject(project)

Status depends on the workflow. So you need to study a bit how the WF is integrated in Jira.

b
Contributor
April 10, 2012

Ok, as Jamie Echlin said, the best solution is to use getGenericValue() method. But unfortunatelly the method is deprecated

Radu Dumitriu
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.
April 10, 2012

Of course, if I understand what you are asking. I confess that I still have doubts.

2 votes
Radu Dumitriu
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.
April 9, 2012

These are on the issue:

issue.getPriorityObject()

etc

b
Contributor
April 10, 2012

Yes, but in that way I will get only one control - priority. But as I said I want to get all like: priority, status, type etc

JamieA
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.
April 10, 2012

Or you can get issue.getGenericValue() and just iterate through the keys. Sounds like something is a bit wrong in your design though.

Mizan
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.
April 10, 2012

Is this what you need ?

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.
April 10, 2012

Your code needs to fetch and process each field that is on the issue.

Some handle very similarly (e.g. affects and fix versions), but most are different, so you actually need to decide what you want to do with them. It's pretty pointless to iterate through the keys, although it will do exactly what you need - give you a long list of stuff you then need to, um, understand, and then process to achieve your end goal.

0 votes
b
Contributor
April 9, 2012

I want to get collection of controls that describe issue. For example issue can use customfields, so I can get

ComponentAccessor.getCustomFieldManager().getCustomFieldObjects(issue)

But how I could do that with default set of controls?

0 votes
Renjith Pillai
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.
April 9, 2012

It's not clear what you want to achieve. If you want to get the data from Jira you can use any of the APIs, REST or SOAP.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events