The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

Cannot use the values from getCustomFieldValue() in IF Condition

Shereen
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!
March 27, 2020

Hi am new in Jira and I currently working on a script.

I was able to get now the value/s of Sytems custom field since the log.debug outputs the values selected.

However it doesn't proceed in the IF CONDITION. Is there other way so that I can access/use the values of a multiselect custom field?

Here is my code.

def systemField = ComponentAccessor.customFieldManager.getCustomFieldObjectsByName("Systems")
def systemValue = issue.getCustomFieldValue(systemField)

log.debug systemValue

if ("Jira" in systemValue) {

do something..

}

else ("Bitbuclet" in systemValue){

do something..

}

 Any suggestions is a great help.

0 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question