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

Suggest an answer

Log in or Sign up to answer