I have a dropdown field A with the following values:
1 - very low
2 - low
3 - medium
4 - high
5 - very high
I want to set the field B based on the dropdown value.
If A is 1 - very low set B=Green
If A is 2 or 3 set B = Yellow
Else set B = Red
I dont have jira automation. I'm trying to do this using JMWE and regular expressions. But I do not know how to write the groovy expression to get this outcome.
Can someone please help me out?
you can use a Set Field Value post-function, select the field to set (B in your example), select "Groovy Expression" as the value type, and for the value use a script like this:
switch (issue.get("A")) {
case "1 - very low":
return "Green";
case "2 - low":
case "3 - medium":
return "Yellow";
default:
return "Red";
}
Hi @David Fischer ,
I would like field B to be updated whenever the value changes in field A. Not just on workflow transition.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Jemima James ,
for that, you can put the aforementioned post-function in a JMWE Event-based action that reacts to the Issue Field Value Changed event for field A.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.