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

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 votes

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.

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

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 Join to answer
Community showcase
Teodora [Botron]
Published Feb 15, 2018 in Marketplace Apps

Jira Inferno: The Nine Circles of Jira Administration Hell

If you spend enough time as a Jira admin - whether you are managing a single, mid-sized instance, a large enterprise one or juggling multiple instances at once - you will eventually find yourself in ...

1,112 views 6 19
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot