Revert Changes to Multi Select Field using JIRA Automation

Ganesh Kumar Vary April 15, 2024

Hi,

We are using JIRA cloud. We have some fields that not supposed to be edited by users which are not part of a specific group. To achieve this, we used JIRA Automation that detects when ever the field is edited & edited by user not in specified group, update the field value with {{fieldChange.fromString}}.

 

The Step-By-Step detail is given below:

Trigger: When value changes for "Custom Field"

Condition: Initiator is not in group "User Group"

Action: Edit Fields "Custom Field" with {{fieldChange.fromString}}

 

The above automation is working fine for text fields. But when it comes to Multi Select fields, the Jira smart value {{fieldChange.fromString}} is returning a string which is not valid for  Multiselect custom field.

Eg: if the multi select custom field has values A, B, C selected, the smart value {{fieldChange.fromString}} is returning A,B,C as a string. If I try to load it to the custom field, the field is getting cleared as the format is not supported.

Can anyone help me solving this issue please.

Thanks & Regards,

Ganesh Kumar Vary

2 answers

0 votes
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 15, 2024

HI @Ganesh Kumar Vary 

Rather than using {{fieldChange.fromString}} you could use {{fieldChange.from}} to get the prior, selected id values, and then parse them to use advanced edit with JSON to set them back.

https://support.atlassian.com/cloud-automation/docs/jira-smart-values-issues/#--fieldChange--

https://support.atlassian.com/cloud-automation/docs/advanced-field-editing-using-json/#Multi-select-custom-field

Kind regards,
Bill

0 votes
Matt Parks
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 15, 2024

Do you have Scriptrunner? If so, then you could create a Behavior that would make the field read-only unless the user was in a particular group.

Otherwise, it appears that the rule would need to know what type of field it needs to set the value.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events