How to create Automation email only showing Assignee issues

Richard Tjong February 17, 2023

Hi all!

I´m trying to create an automation where an email is sent to assignees and only showing the assignees issues, not anyone elses. At the moment, the automation will run a  JQL search, if the search matches assignee, it proceeds to send emails to those assignees. However it will list every issue found from the JQL.

Is there a smartvalue or automation component which I can include to show only the email recipients issues in the email?

Trigger: Scheduled JQL search

Then: Lookup issues using JQL

If matches: Assignee

Then send Email (below)

Hi {{issue.assignee.displayName}}
Due date for your assigned issues in the project is approaching in the next 7 days.
Please update the progress of your issue.
<b><u>List of issues:</u></b>

{{#lookupIssues}}

Issue Key: <b>{{key}}</b> (<a>{{url}}</a>)
Summary: <a>{{Summary}}</a>
Assignee: <a>{{assignee.displayName}}</a>

{{/}}

 

Thanks in advance!

2 answers

2 accepted

1 vote
Answer accepted
Rilwan Ahmed
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 17, 2023

Hi @Richard Tjong ,

Please follow below steps 

1. Navigate to Filters -> Advanced issue search

2. Use the following JQL search clause (if the due date is due in 7day);

assignee = currentUser() AND resolution is EMPTY AND duedate = 7d

3. Click 'Save as' to save the filter

4. On the same page, click on 'Details' right next to 'Save as' and click on 'New subscription' and then configure how often you want the notification to be sent to you.

When you select "Personal Subscription", only you will receive the emails
You can select the group and it will send email to each user and only their tickets in the email 

https://www.atlassian.com/blog/jira-software/jql-the-most-flexible-way-to-search-jira-3-of-4
https://confluence.atlassian.com/jira064/receiving-search-results-via-email-720416706.html

Richard Tjong February 20, 2023

Hi Rilwan!

This worked perfectly, thank you! Managed to assign all the groups recurring filter subscriptions. Now each assignee will recieve a list of their current issues with due dates within 7 days on a weekly basis. 

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.
February 17, 2023

Hi @Richard Tjong 

Would you please clarify your scenario, as that may help the community to offer suggestions?

For example, are you trying to:

  1. For one specific assignee (e.g., always the same user) run the scheduled rule to send their issues list
  2. For any issue found which are coming, send to each individual user their list of issues

Scenario #1 can be handled by changing the JQL of the lookup to only reference the specific user.

Scenario #2 can be handled using a generic lookup for upcoming issues, which is then parsed to send each email with an advanced branch.

Kind regards,
Bill

Richard Tjong February 20, 2023

Hi Bill!

Scenario number 2 is what I was looking for. I wanted to send an automated email with a list of all the issues of the email recipients (assignees), within a timeframe. Tried to solve it with Automation however we had too many project members to create branching actions, and the list smart value showed all issues and not assignee specific.

However, managed to solve this with Filter subscriptions and JQL which returns the current logged in user. This solution works great!

Thank you for suggestion your solution!

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.
February 20, 2023

Hi, Richard.

I am glad to learn you solved this with filter subscriptions.

FYI for what I was suggesting, I did not mean to create a branch for each person, as that  could be a very long rule!  Instead you can use the lookup to drive the branch, like this:

  • trigger: scheduled with no JQL
  • action: lookup issues, with the JQL, to find the issues of note
  • advanced compare condition: to check for issues with {{lookupIssues.size|0}} is greater than 0
  • advanced branch: over the possible assignees.  The key is using distinct to walk the users/people who have assigned issues.
    • variable: varAssigneeAccountId
    • smart value: {{lookupIssues.assignee.accountId.distinct}}
      • action: lookup issues again with the JQL, adding on assignee = {{varAssigneeAccountId}}
      • action: send your email to the specific person/user

Kind regards,
Bill

Richard Tjong February 21, 2023

Hi Bill,

I tried this out, in one of the last steps I couldnt add a smart value {{varAssignee.accountId}} to the JQL. What would the JQL be for this smartvalue?

  • trigger: scheduled with no JQL
  • action: lookup issues, with the JQL, to find the issues of note
  • advanced compare condition: to check for issues with {{lookupIssues.size|0}} is greater than 0
  • advanced branch: over the possible assignees.  The key is using distinct to walk the users/people who have assigned issues.
    • variable: varAssignee
    • smart value: {{lookupIssues.assignee.distinct}}
      • action: lookup issues again with the JQL, adding on assignee = {{varAssignee.accountId}}
      • action: send your email to the specific person/user
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.
February 21, 2023

Hmmm...I believe that should work.  Would you please show the JQL you are trying to use in the Lookup Issues action, inside of the branch?

Richard Tjong February 22, 2023

This is the JQL im using for the first lookup issues search

  • project = ABC AND assignee = currentUser() AND due >= "0" AND due <= 7d

This is the JQL for the second search in the advancing branch

  • project = ABC AND assignee = currentUser() AND due >= "0" AND due <= 7d AND Assignee = {{varAssignee.accountId}}

Also tried with the Assignee = varAssignee but the JQL doesnt accept either. Perhaps i misread where to add this in the JQL? Sorry still new to Jira.

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.
February 22, 2023

Thanks for that information!

When you are using the scheduled trigger technique I noticed, you do not use a test on currentUser() as that would only evaluate to the "Automation for Jira" user.

I will clarify the example rule I posted above for your second question.

Suggest an answer

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

Atlassian Community Events