Forums

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

How can I get all custom fields that belong to a certain JIRA Service Desk request type?

Wesley Falcao
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!
June 27, 2016

Here's how I can get all custom fields for an issue -

CustomFieldManager customFieldManager = ComponentAccessor.getCustomFieldManager();
List<CustomField> allCustomFields = customFieldManager.getCustomFieldObjects();
        
        for(CustomField f : allCustomFields) {
            Object value = issue.getCustomFieldValue(f);
            // more code    
        }

EDIT  June 27 2016 5 PM EST :

How can I do the same for a service desk request type - https://confluence.atlassian.com/servicedeskcloud/creating-service-desk-request-types-732528762.html

How can I do the same for a workflow?

 

1 answer

1 vote
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.
June 27, 2016

Fields don't belong to workflows, they belong to issues.

Some workflows might refer to fields in functions or screens - is that what you mean?  You'll need to read the workflow xml for those.

Wesley Falcao
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!
June 27, 2016

Hmmm. You're right. I confused myself between "workflows" and "request types" in JIRA Service Desk.

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.
June 27, 2016

Ah, I see.  Then it's sort of a yes, but with an extra layer.  Request types map on to JIRA issue types, so if you can work out that mapping, you can use the same method to get the fields  (I've not tried it, so I'm not sure how to get there)

Suggest an answer

Log in or Sign up to answer