Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

Jira - groovy - get custom fields from screens of project


I need get list of custom fields which I have on all of screens on a project.

Have you any advice how can I get this by groovy script?






2 answers

Hi Lukas,

I ended up in the exactly same situation as you and solved it by:


//imports ad lib...

Set<String> getFieldsOnScreen(FieldScreenScheme fieldScreenScheme, IssueOperation issueOperation) {
CustomFieldManager customFieldManager = ComponentAccessor.getComponent(CustomFieldManager)
Set<String> result = new HashSet<String>()

FieldScreen fieldScreen = fieldScreenScheme.getFieldScreen(issueOperation)
fieldScreen.getTabs().each{FieldScreenTab fieldScreenTab ->
fieldScreenTab.getFieldScreenLayoutItems().each{FieldScreenLayoutItem fieldScreenLayoutItem ->
String fieldId = fieldScreenLayoutItem.getFieldId()
// I am only interested in custom fields - change appropriately
if (fieldId.startsWith("customfield")) {
CustomField customField = customFieldManager.getCustomFieldObject(fieldId)

return result

Set<String> getFieldsOnScreens(FieldScreenScheme fieldScreenScheme) {
// I am only interested in Edit and View screens - change appropriately
return getFieldsOnScreen(fieldScreenScheme, IssueOperations.EDIT_ISSUE_OPERATION) + getFieldsOnScreen(fieldScreenScheme, IssueOperations.VIEW_ISSUE_OPERATION)

IssueTypeScreenSchemeManager issueTypeScreenSchemeManager = ComponentAccessor.getIssueTypeScreenSchemeManager()

IssueTypeScreenScheme issueTypeScreenScheme = issueTypeScreenSchemeManager.getIssueTypeScreenScheme(<My Project>)
FieldScreenScheme fieldScreenScheme = issueTypeScreenScheme.getEffectiveFieldScreenScheme(<My IssueType>)

return getFieldsOnScreens(fieldScreenScheme)

Hi Sune,

the easiest way I saw on this site.

By the way, it does not take care of the "technical" fields hidden in transition screens nor postFunctions.


+1 anyway.

Hi Lukas,

I can show you how to get a list of all fields on the screens for a given issue if that helps.


Adam Sasin
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!
Mar 09, 2023

Would you like to share with us this knowledge?

Adam Sasin
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!
Mar 09, 2023

im asking because i don't know how to get what custom field i have for view screen for specific issue type by groovy

Hi Adam,

The code I pasted above should do it.


Suggest an answer

Log in or Sign up to answer
AUG Leaders

Atlassian Community Events