Forums

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

Custom Field get value

Carmine Fabrizio September 23, 2019

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 Champion
September 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

Carmine Fabrizio September 23, 2019

perfect thanks!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events