2 Custom user fields, missing user should get a Mail

Christoph Schulz November 11, 2024

Hello Atlassians,

 

i've tried the new AI Tool which is pretty cool for helping at building automation rules but iam currently stuck, since iam unsure about the correct punctuation & coding.

 

Iam trying to match 2 user fields and Mail the missing users.

Field A

User 1,2,3

 

Field B

User 1,3

 

So i would like to inform only user 2.

AI wrote this into a Variable 

{{#issue.customfield_10003.value}} {{^issue.customfield_10126.value}} {{.}} {{/}} {{/}}Screenshot 2024-11-11 092614.png

 

It didn't work or maybe i did something unexpected.

Regards

 

2 answers

1 accepted

0 votes
Answer accepted
Christoph Schulz November 11, 2024

{{issue.customfield_10126.value.remove(issue.customfield_10003.value]}}

 

should this do the it ?

Christoph Schulz November 11, 2024

almost :)

 

value]}} wrong bracket

 

Ugnius Aušra
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.
November 11, 2024

@Christoph Schulz 

Did you solved this problem by yourself? 

Like Christoph Schulz likes this
Christoph Schulz November 11, 2024

Yes it worked! 

 

 

Christoph Schulz November 11, 2024

@Ugnius Aušra thanks for the help! Cheers!

Like Ugnius Aušra likes this
0 votes
Ugnius Aušra
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.
November 11, 2024

Hello @Christoph Schulz ,

Welcome to Atlassian community,

Now if we are trying to solve this problem using Jira automation, i would suggest to do like this:

Check Fields Are Not Empty:

  • Add an Issue Fields Condition to ensure both Field A and Field B are populated:
    • Condition 1: Field A is not empty
    • Condition 2: Field B is not empty

 

Branch Rule / Related Issues (for each user in Field A):

  • Add a Branch Rule action, selecting For each value in Field A. This iterates over each user in Field A, allowing you to perform comparisons individually.

Condition - Check if User is Missing from Field B:

  • Inside the branch, add a Condition that checks if the current user (from Field A) is missing in Field B.

  • Use the following Advanced Compare Condition:

{{issue.Field B.asList.contains(issue.Field A.value)}}

  • Set the condition to False so it proceeds only if the user in Field A is not present in Field B.

Add User to Missing List:

  • Create a Create Variable action to temporarily store the missing users as they’re identified.

  • Set the variable to something like missingUsers, with the value:

{{missingUsers}}, {{issue.Field A.value}}

  • This will dynamically build a comma-separated list of missing users.

Send Email Action:

  • After the Branch Rule completes (add this action outside the branch), add a Send Email action to notify yourself or relevant recipients of the missing users.

  • In the Email Body, you can insert the missing users using the variable {{missingUsers}}:

Subject: Missing Users Report

The following users are in Field A but missing in Field B:
{{missingUsers.remove(", ")}}

/--

Let me know, if this solution is working for you.

Best regards,

Ugnius

 

 

 

Christoph Schulz November 11, 2024

Only got empty Mails.

Ugnius Aušra
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.
November 11, 2024

@Christoph Schulz Can share audit log of that automation?

Christoph Schulz November 11, 2024

Details zur Aktion:
["10172"]


-Bedingung
Folgende Vorgänge haben die Bedingung nicht bestanden:
UN-18, UN-7


E-Mail senden
Die E-Mail für Vorgänge mit folgenden IDs wurde erfolgreich versendet:
UN-18 , UN-7 

 

It sent correct Mails but left the value in the Mails empty i've put {{missingUsers.remove(", ")}} inside.

Suggest an answer

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

Atlassian Community Events