Forums

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

All ways to set custom fields values based on condition ??

Narendra Kumar
Contributor
April 13, 2020

Hi,

I have a list of ~100 entries that have combination of five fields. 

Suppose if-

field1 ="1" and field2 = "2" => field3 ="A" , field4 = "B" , field5 = "C"
field1 ="1" and field2 = "1" => field3 ="A" , field4 = "C" , field5 = "B"
field1 ="2" and field2 = "2" => field3 ="B" , field4 = "B" , field5 = "D"
field1 ="2" and field2 = "1" => field3 ="F" , field4 = "A" , field5 = "F"

and so on.

How to write script for this and what could be the best way to check values for field1 and field2 and based on those values I want to set  values for another three custom fields.

As we can use if...else concept but entries are so large so code length will be impacted and time complexity is also an issue.

Please suggest best code that can be written using list, map etc concept in groovy.

Thanks in advance.

1 answer

0 votes
Narendra Kumar
Contributor
April 14, 2020

@Nic Brough -Adaptavist-  please help me here to find solution for this script. Thanks!

Suggest an answer

Log in or Sign up to answer