Currently, edits to custom fields in Jira Cloud and Jira Service Management Cloud cannot be restricted per field without creating cumbersome workflow transition loops on a status. As an alternative, automation rules can be configured to revert changes made to a field if the change was made by an unauthorized user. The reversion will set the field back to how it was populated before the most recent change. This article instructs how to revert the following custom field types:
This custom field type is sometimes referred to as a 'multi select dropdown' or 'multi choice dropdown' field. To revert changes made to it by an unauthorized user, in your automation rule, add the following components in this order:
{{fieldChange.from.replaceAll("\\[", "").replaceAll("\\]", "").replaceAll("\\s*,\\s*", ",").replaceAll("([^,]+)", "{\"id\":\"$1\"}")}}
{
"fields": {
"customfield_XXXXX": [{{previousValue}}]
}
}
This should successfully revert your multi select dropdown field back to the previously selected value(s). Depending on the value options you have in your field, you may have to adjust 2.2.1 above to account for text variances. Here's are screenshots of the rule in case it's helpful (irrelevant components are blurred out):
This custom field type is sometimes referred to as a 'single select dropdown' or 'single choice dropdown' field. To revert changes made to it by an unauthorized user, in your automation rule, add the following components in this order:
{{fieldChange.from}}
This should successfully revert your custom single select dropdown field back to the previously selected value. Here's a screenshot of the rule in case it's helpful (irrelevant components are blurred out):
These custom text field types are sometimes referred to as 'multi line text' or 'single line plain text' fields respectively. To revert changes made to either field type by an unauthorized user, in your automation rule, add the following components in this order:
{{fieldChange.fromString}}
This should successfully revert your custom text field back to the previously selected value. Here's a screenshot of the rule in case it's helpful (irrelevant components are blurred out):
These instructions work for optional and required fields. Please note: required fields always require a value, so if the previous state of a field was empty, then the automation rule may fail.
This article serves to elaborate on the field change documentation provided by Atlassian. Please see aforementioned documentation for more field change management options.
Additional resource: Smart Values in Jira Automation.
Alexa
Atlassian Administrator
Torc Robotics
Blacksburg, VA
1 comment