Automation rule not triggered when using the field value changed trigger and custom field with special characters
Platform Notice: Data Center - This article applies to Atlassian products on the Data Center platform.
Note that this knowledge base article was created for the Data Center version of the product. Data Center knowledge base articles for non-Data Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
The automation rule doesn't get triggered. This happens for one specific rule that uses the trigger Field value changed. Other rules are not affected. The custom field contains special characters.
Environment
Jira 8.x, 9.x ,10.x with A4J (Automation For Jira)
Diagnosis
When checking on the rule, the trigger Field value changed has not been selected from the drop-down list of selectable fields. Instead the option to match the custom field name has been used. The custom field contains characters such as for example:
(){}[]
Example in Jira:
With the custom field name customer(s) this rule would not get triggered.
Cause
When using the option to match the custom field name, Jira makes use of the regex rules. Regular Expressions or regex make use of patterns and wildcards. The special characters in the name of the custom field are part of these special characters also known as metacharacters. To make sure the characters are correctly identified, they will need to be escaped.
Solution
You will need to escape the special characters using the \
Example:
custom field name | in rule |
---|---|
customer(s) | customer\(s\) |
With the custom field name customer(s) this rule would get triggered.
You can make use of Regex101 or other regex testers to verify that the custom field name would be matched.