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,466,078
Community Members
 
Community Events
176
Community Groups

Automations referencing Filters

We have an advanced Filter, "Recent Customer Issues" which uses JQL. And we're successfully using that Filter in a Dashboard. Now, I need to create an email which includes the results of that same Filter, in addition to some other text. I'm trying to avoid copy-and-pasting the JQL from the filter, so the Dashboard and Email will remain consistent.  

My first attempted solution is using Global Automation, and the Lookup Issues action. Is there a way that I can reference that Filter in the Lookup Issues? Trying {{Recent Customer Issues}} in the JQL field applies no filter. 

  1. Is there a way for me to reference the Filter from Automations, without copy-and-pasting the JQL?
  2. Alternatively, is there a way for me to email the Dashboard, or reference it in an Automation?

Thanks,
Dan

2 answers

1 accepted

0 votes
Answer accepted

Hi @Dan Rohtbart -- Welcome to the Atlassian Community!

If you have used a saved filter for your dashboard gadget, you can use that same filter in the automation lookup issues action by referencing the filter id.

View your saved filter to note the id in the browser address bar URL, and then use that in the lookup JQL as:

filter = 12345

Please note: automation rules actions, branches, and triggers are limited to processing 100 issues.  If your filter returns more the result will only contain the first 100 issues.

Kind regards,
Bill

@Bill Sheboy this looks absolutely perfect. Thank you so much. 

Like Bill Sheboy likes this

Even better, you can combine filters: 

(filter = 10041) or (filter = 10042)

Hi Bill, is it possible to use the size (as in issue count) of a given filter?

Thanks,

Hi @Claudio Rouillon 

You cannot get the count by running a query directly with the Jira UI, but you can do so with other methods:

  1. for Jira Cloud automation, using Lookup Issues with the JQL, and then check {{lookupIssues.size|0}} for the count (adding a default of zero to avoid nulls)
  2. for Jira Server/Data Center automation with bulk processing, use {{issues.size|0}}
  3. for a REST API call, check the count shown in the response message
  4. for a custom written application calling the REST API, same as #3 except whatever collection/list sizing your language uses

Kind regards,
Bill

Like Claudio Rouillon likes this

Thanks Bill,.  I have tried the first option within an automation rule and found 2 problems... (1) I get one email per issue returned from the list... I would prefer all issues listed in 1 email, couldn't figure out how to. (2) the size is returning 0. See below.

Jira autom weekly emailrule email example.JPG

Jira autom weekly emailrule 2.JPGJira autom weekly emailrule 1.JPG

Hi Bill, after a few trials I figured it out... here is my rule with the count (size) of the issue list in the Subject line. Thanks for your help !

Jira weekly list rule.JPG

Hi @Claudio Rouillon 

Just to confirm, are you using Jira Cloud or the Server/Data Center version?

It appears you are using Cloud, so...

With this type of rule you do not use JQL with the scheduled trigger.  Instead you only use the Lookup Issues action, and then there will be one email, referencing the {{lookupIssues}} smart values.

I noted you referenced the {{issues}} smart value, noting the plural word.  That smart value is used with Jira Server/Data Center for bulk-issue processing, whereas Cloud uses Lookup Issues.

Like Claudio Rouillon likes this

Hi Bill, yes we use Jira Cloud. And yes, we used {{#LookupIssues}}. Thanks for helping out.

Like Bill Sheboy likes this
1 vote
Craig Nodwell Community Leader Mar 24, 2022

Hi Dan, have you looked into Group Subscriptions.
See: Subscribe to search results on this page
Work with Search Results 

Hope this helps.

Suggest an answer

Log in or Sign up to answer