It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Custom Field get value

Hi there,

I have a custom field with a drop-down menu, and I would like to get the value of it, I was checking via API how it looks and for some reason, I'm getting this 

"customfield_11905":[{"self":"https://my-jira.com/rest/api/2/customFieldOption/11800","value":"Lab","id":"11800"}]

in my grrovy script I have this  

def customFieldManager = ComponentAccessor.getCustomFieldManager()

def cFieldName = customFieldManager.getCustomFieldObject("customfield_11910")

How can I get just the "value":"Lab"? any idea ?

Thanks

1 answer

1 accepted

0 votes
Answer accepted
Leo Community Leader Sep 23, 2019

Hi @Carmine Fabrizio,

 

You can use getCustomFieldValue(cFieldNmae) method to get the selected value in your script. e.g.

def otherFaveFruit = issue.getCustomFieldValue(faveFruitOtherFld) as String 

 

BR,

Leo

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted in Jira

Demo Den Ep. 7: New Jira Cloud Reports

Learn how to use two new reports for next-gen projects in Jira Cloud:  Cumulative flow diagram and Sprint burndown chart. Ivan Teong, Product Manager, Jira Software, demos the Cumulative ...

302 views 1 3
Join discussion

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you