Forums

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

Set a value based on other values

Yepraksia Hovhannisyan March 8, 2020

Hi. I use JIRA Cloud. I have JMWE extension. I want to do the following: 

Fields: 1. priority 2. severity 3. Urgency

When priority = high and severity = major then urgency = P1 

OR

priority = urgent and severity = critical then urgency = P1

OR 

priority = low and severity = trivial then urgency = P3

 

I don't know how to write the condition

 

1 answer

1 accepted

0 votes
Answer accepted
David Fischer
Community Champion
March 10, 2020

I assume you want to calculate the Urgency field during issue creation, right? In that case, you need to add a Set Field Value post-function to the Create transition of your workflow, to set the "Urgency" field.

You did not mention what should happen if none of the three conditions are met (e.g. priority = high and severity = trivial). I'll assume everything is P3 unless it's P1.

You can use a template like this:

{% if issue.fields.priority.name == "High" and issue.fields.severity.value == "Major" %}
P1
{% elif issue.fields.priority.name == "Urgent" and issue.fields.severity.value == "Critical" %}
P1
{% else %}
P3
{% endif %}

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events