How to set bgcolor based on custom field value - Jira WorkFlow Toolbox post function - send an email [IMPORTANT]
Hi, I am currently validating your add-ons, and I have a case. I want to make an email containing custom field single select value, there are "OK", "NOT OK", and "N/A"
in Jira WorkFlow Toolbox post function - send an email, i created a Table, and i want to set the bgcolor based on custom field value, like this : if value="OK" set bgcolor to green if else value="NOT OK" set bgcolor to red else set bgcolor to orange
Can you please help to solve my case?
Thank You
Comments (5)
-
repo owner -
repo owner Now, I notice that you are using a quite old version of the plugin. In your case you should use the following text expression:
%{nnnnn} = "OK" ? "#008000" : (%{nnnnn} = "NOT OK" ? "#B22222" : "#FF8C00")
replacing nnnnn with field code for your single Select List field.
-
reporter Hi @fcarmario Thanks for your answer. it's really works for me. I'am using v7.4.1 Jira Software
-
repo owner - changed status to resolved
Then I close the issue. Please, reopen it if you find any problem in this solution.
-
reporter - changed status to resolved
- Log in to comment
Hi @antoniiusadit,
Currently Send an email post-function doesn't provide advanced parsing mode for the body of the email, so you can't create conditions like the one you need here, but you can use the following workaround:
Before Send an email post-function, you can use Copy a parsed text to a field post-function in advanced parsing mode for storing in Ephemeral string 1 (field code
%{00061}
) the color, and then you can use field code%{00061}
for setting bgcolor in the email body.In Copy a parsed text to a field you should use the following configuration:
replacing nnnnn with field code for your single Select List field.