Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Automation: If multi-user picker field A= multi-user picker field B, then edit

Stewart_ Emily _ Global D_T
Contributor
August 13, 2025

Hello, 

I'm trying to setup an automation rule so that when a custom field UC Approved By (cf[12959]) is edited, if UC Approver (cf[12858] multi-user picker field) values equals UC Approved By (cf[12959] multi-user picker field) values, then edit UC Approved and UC Status. However, the automation rule keeps throwing an error: "IF or ELSE: Add condition options"..."Unexpected error while executing rule."

I've tried using the customfield_id and custom field name. I've tried quite a few things and sadly lost many hours before finally reaching out for help. TIA!

image.pngimage.png 

2 answers

1 accepted

0 votes
Answer accepted
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.
August 13, 2025

Hi @Stewart_ Emily _ Global D_T 

There is no automation list sort function, although there is an open suggestion to add that function.

 

For your scenario:

GIVEN an issue with multiple-select, user picker custom fields: "UC Approved By" and "UC Approver"
WHEN "UC Approved By" changes
AND the selected values in both fields match
THEN edit custom fields UC Approved and UC Status

One possible workaround is to use dynamic regular expressions to compare the values after removing any matches, testing in both directions (to avoid any subsets for one field in the other).

 

Kind regards,
Bill

Stewart_ Emily _ Global D_T
Contributor
August 14, 2025

Thanks, Bill. I think you overestimate my abilities and would greatly appreciate more information about your suggested workaround.  I modified the rule to put the condition on the WHEN and removed the sort, join, etc. part of each smart value, but I'm still getting the same error.

image.png

 

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.
August 14, 2025

No worries, as we all are learning...especially as automation rules features evolve :^)

 

I did a quick test, and found that behind the scenes, Jira appears to return the users in a multiple-selection user field in ascending order by account ID to an automation rule.  If that is reliable, the condition you show should work.

I wonder if the problem is using the condition in the trigger...as that new feature has been shown to have problems with timing (i.e., how fast the rule gets the data).

Let's try this version of the rule, adding some writes to the audit log to confirm the behavior is as expected:

  • trigger: field value changes for UC Approved By
  • action: log, to write the first field to the log
UC Approved By: {{issue.customfield_12959.accountId}}
  • action: log, to write the second field to the log
UC Approver : {{issue.customfield_12858.accountId}}
  • smart values condition:
    • first value: {{issue.customfield_12959.accountId}}
    • condition: equals
    • second value: {{issue.customfield_12858.accountId}}
  • action: edit work item fields, to update UC Approved, and UC Status

 

Please try that rule, reviewing the audit log to confirm the values have what you expected.

Stewart_ Emily _ Global D_T
Contributor
August 14, 2025

Hooray! I reconfigured the rule as you suggested, confirmed the two logs matched, and still got the error; however, then I removed the branch before the last If-Then duo, and it worked. Thank you so much!

image.png

Like Bill Sheboy likes this
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.
August 14, 2025

Awesome; I am glad to learn that helped!

 

And...that branch type should not have caused that symptom.  I hypothesize something got "glitched" behind the scenes, and removing the branch solved this because...

When a rule is edited / published too many times, the stored rule JSON can get bent / broken, resulting in weird errors.  The two ways to check this are:

#1) Disable the rule, wait a full minute, re-enable it, and test again.  If that does not work...

#2) Disable the rule, re-create it from scratch, and test.  If it works, delete the original / broken rule.

 

0 votes
Varsha Joshi
Community Champion
August 13, 2025

I would create a email component before your if statements to see what values are being returned, that might help you debug it.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
ENTERPRISE
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events