How to Revert the Values in Text and Select List Custom Fields

Introduction

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:

  • Select List (single choice)
  • Select List (multiple choices)
  • Paragraph (supports rich text) / multi line
  • Short text (plain text only) / single line plain text

 

Revert Changes to a Select List (Multiple Choices) Field

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:

  1. An IF or ELSE condition that checks for the authorized permissions, such as a user being in a group or not in a group.
  2. Create a variable.
    1. Name it whatever you'd like. I'm using 'previousValue' as my example.
    2. For the 'Smart value' field, use this to parse the multiselect values:
      1. {{fieldChange.from.replaceAll("\\[", "").replaceAll("\\]", "").replaceAll("\\s*,\\s*", ",").replaceAll("([^,]+)", "{\"id\":\"$1\"}")}}
  3. Edit issue fields.
    1. In the 'Additional fields' section, paste what's below:
      1. {
        "fields": {
        "customfield_XXXXX": [{{previousValue}}]
        }
        }
      2. Replace 'XXXXX' with your field ID.
      3. Replace the 'previousValue' text with whatever variable name you chose in the previous step (leave all the brackets in place).

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):

multi-select-dropdown-field-automation-rule-component-part1.png

multi-select-dropdown-field-automation-rule-component-part2.png

 

Revert Changes to a Select List (Single Choice) Field

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:

  1. An IF or ELSE condition that checks for the authorized permissions, such as a user being in a group or not in a group.
  2. Edit issue fields.
    1. Select the custom single select dropdown field you want to revert when changes are made by an unauthorized user.
    2. Paste or type in the following instead of choosing a field option: 
      1. {{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):

single-select-dropdown-automation-rule-component.png

 

Revert Changes to a Paragraph or Short Text Field

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:

  1. An IF or ELSE condition that checks for the authorized permissions, such as a user being in a group or not in a group.
  2. Edit issue fields.
    1. Select the multi line text or single line plain text field you want to revert when changes are made by an unauthorized user.
    2. Paste or type in the following: 
      1. {{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):

custom-text-field-automation-rule-component.png

 

Important Notes

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.

 

Related Resources

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.

1 comment

Mary Agueros
Contributor
February 11, 2025

Thank you @Alexa for publishing the details on how to revert changes on custom fields.  

Like Alexa likes this

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events