Forums

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

ScriptRunner Post-Function: Create Subtask Condition from custom Multi-select field

sclarke-aptos-com
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!
January 25, 2022

I have a customer multi-select field. Unfortunately there are multiple custom fields of the same name. I'm trying to use a condition to create a subtask based on values of the field. I can create a list based on the custom field, iteration through the values 

Screenshot 2022-01-25 135044.jpg

The logging indicates its picking up the values and setting the return var. However the condition is always evaluating as true (creating the subtask)

the example code snippets are pretty simplistic and typically have a boolean condition between two fields. 

How can I pass the value of my check out, so that the condition picks it up?

 

thanks

Simon

 

1 answer

0 votes
Antoine Berry
Community Champion
January 26, 2022

Hello @sclarke-aptos-com ,

Your logic and script seem fine. I would add .getValue() so you can compare Product1 values to a String, i.e. : 

if (it.getValue() == "A") { ... }

Let me know if that helps.

Suggest an answer

Log in or Sign up to answer