I am trying to define an automation rule based on Smart Values that sets the priority of an issue based on finding in the issue description the value of a severity. The issue is originated via mail from a different ticketing system.
The logic would be something like:
- If summary contains "Severity" and after Severity I find:
- "Low" then priority is P4
- "High" then priority is P2
- "Critical" then priority is P1
By default, tickets are P3.
I have tried different approaches, none of them seem to work:
- Branching, which seems to work, but after branching setting the priority I need to clone the ticket into another project and carry over the priority, and in some cases it hasn't been updated in time, which clones the ticket with incorrect priority
- IF/THEN actions, which could work but would force me to copy all actions in the 4 different branches, which does not sound right to me
- Smart values like this work in an EDIT field action:
{
"fields": {
"priority": {
"name": {{#if(issue.description.substringAfter("Severity").substring(1,50).match(".*(Critical).*").isNotEmpty())}}"P1"{{/}}
}
}
}However, I can't use them to set different cases as per my logic, and If I try to duplicate the edit action as per my conditions, it retrieves the error invalid JSON, I suppose because it does not accept different values for the same field even when there is an #if
Any recommended approach for this?