Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,556,653
Community Members
 
Community Events
184
Community Groups

Send email notification to user in custom field using Lookup issues

Hello everyone.

We have a custom field called "Procurement Initiator" which is a user picker field. Is there a way to send a list of tickets to the user selected in the mentioned field?
To be more specific I would like for each user selected as Procurement Initiator to only get tickets where their account is present.

Here is how the rule is currently setup:1.PNG

NOTE 1: There is no JQL in the first component of the rule (Scheduled)
NOTE 2: If I were to add an email in the "To" section of the Send email component, the rule would work and would send a list of tickets with all tickets that satisfy the provided JQL in the Lookup issues component.

 

It is not possible to create separate rules for each Procurement Initiator since more than 100 users can be selected as one.

 

Thank you for the help.

 

1 answer

1 accepted

1 vote
Answer accepted
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 11, 2023

Hello @Danilo Simic 

Take a look at the Answer from @Kian Stack Mumo Systems  on this post.

After the Lookup you need to add a branch to loop over the unique Procurement Initiator values (where the answer shows cars). Within the branch you do another Lookup for issues for each Procurement Initiator, and send an email with those results.

Thank you for the suggestion. I took a look but I am failing to make it work.

I am afraid I am missing something trivial. Here is the rule setup and what the error looks like in the audit log:

1.PNG

 

The rule is made up of the following modules:

  1. Schedule module - No JQL present

  2. Lookup issues with the following JQL: created <= -30d and status not in (Approved, Rejected) and "Procurement initiator[User Picker (single user)]" = 63aed024082abdd71bb57d41
    As you can notice I have included only 1 user account, this is my account so that I do not send email notifications to other users anymore.
  3. Branching module with the following smart value: {{lookupIssues.Procurement initiator.value.join(",").remove("[").remove("]").replace(", ",",").split(",").distinct}}
  4. Lookup issues with the following JQL: "Procurement initiator" in ({{ProIni}})
  5. Send email module - right now it is trying to send an email to the lookup value but I have also tried adding {{ProIni}} and the field itself which did not work. When I added my own email I got an email but no issues were present in the list
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 12, 2023

The easier problem to address is the email issue. For the Send Email action you need to provide the email address for the user. To do that for a value from a single user picker field you would append .email to the smart value; i.e. {{issue.assignee.email}}

The more complicated issue is the smart value in your branch. Where did you get that code? I have seen things like that but haven't actually used it. I think it is incorrect. When I try to use it myself I'm finding that it provides no value back to me.

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 12, 2023

This works for me. I used the Assignee field for testing.

Screen Shot 2023-05-12 at 3.23.52 PM.png

 

Step 1:

Screen Shot 2023-05-12 at 3.24.35 PM.png

 

 

Step 2:

Screen Shot 2023-05-12 at 3.24.43 PM.png

 

Step 3:

Screen Shot 2023-05-12 at 3.24.51 PM.png

 

Step 4:

Screen Shot 2023-05-12 at 3.24.59 PM.png

I found the code on the community post you provided me with in your first reply.

 

I tried changing the automation rule to match your setup:

1.PNG

2.PNG

customfield_10046 is the "Procurement initiator" field

3.PNG

4.PNG

 

With this rule setup I get an error saying that there is no email provided:

5.PNG

 

Judging from the audit log, the lookup module finds the correct issues.

Am I missing something obvious? Did I maybe not write the customfield property correctly? 

 

Thank you for the help, sorry for being difficult.

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 15, 2023

You need to be using the field name, not the variable name, in the smart value to use in the TO field for the Send Email action.

I got the same error

1.PNG2.PNG

 

I also tried typing {{lookupIssues.first.Procurement initiator.emailAdress}} in the "TO" section of the Send email component and got the same error like in the screenshot.

 

Then I tried with the following changes:

3.PNG

The error message is a bit different this time:

4.PNG

 

I do not understand why the error message says that there is no issue present when the 2 lookup modules find issues without any problems.

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 16, 2023

You have misspelled the smart value in the TO field. I'm sorry I didn't notice that. emailAddress needs to have two "d"s

{{lookupIssues.first.Procurement initiator.emailAddress}}

I am such a fool. Now the rule works great. Thank you very much for the help.

 

Side question, if I wanted to also edit those ticket for which I just send an email, how would I approach that?

Never mind my last side question. It is not needed and will not be needed.

 

Once again, thank you very much for the help.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events