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,298,096
Community Members
 
Community Events
165
Community Groups

Automation - Sending an email containing multiple JQL search queries

Good morning!

I am trying to create an automated email to send out meeting agendas every week. Each agenda that I make uses issues from five different JQL searches, and lists the results of each search in the email.

Currently, I am doing this manually, and the emails look like this:

-------------------------------------------------------------------
Good morning! Here are the topics we will look at today

[filter-one-name]
issue-result-1001    issue_summary_here   custom_field_value
issue-result-1002    issue_summary_here   custom_field_value

[filter-two-name]
issue-result-2001    issue_summary_here   custom_field_value

[filter-three-name]
issue-result-3001    issue_summary_here   custom_field_value
issue-result-3002    issue_summary_here   custom_field_value

I'll see you later!
-------------------------------------------------------------------
And eventually I was thinking about using HTML in the emails to make the columns prettier.

 

 

So far, I looked into using an automation rule to send an email, however I was only able to produce something like the below, using results from a single JQL search and the {{issues}} smart value.

-------------------------------------------------------------------
Good morning! Here are the topics we will look at today

[filter-one-name]
issue-result-1001
issue_summary_here
custom_field_value

issue-result-1002
issue_summary_here
custom_field_value

I'll see you later!
-------------------------------------------------------------------

I am not quite sure how to send an email and include information on more than one search query. I've also looked into using filter subscriptions as a way to compile and send filter results, though I don't know how to automatically compile more than one filter result into an email, AND to include a header and footer.

 

I was wondering if there was any way in out-of-the-box Jira to automate sending these emails?

If it is not possible for out-of-the-box Jira, I also have access to script runner, and would appreciate some tips on making a script for this automation!

1 answer

1 accepted

0 votes
Answer accepted

Hi @Liam Cass  -- Welcome to the Atlassian Community!

A couple of ways to do this (including one you mentioned) are: a dashboard and automation rules.

Dashboard (pull approach): Create a dashboard listing/visualizing your different queries and manually send an email (or use an email scheduler/meeting invite) with a link to the dashboard for people to view.  A couple advantages of this approach are it is not limited to 100 issues, as are automation rules actions, and visualizations may help see aspects of the issues.

Automation rule (push approach):

  • You are using Jira Cloud (correct?) and so you can use the Lookup Issues and Create Variable actions to help
  • For each query, call Lookup Issues with JQL, and save the results in a created variable...adding any formatting (HTML, line breaks, etc.) you wish.  Automation rule actions are limited to 100 issues, so if you expect more this may not help you.
  • Use the Send Email action to then reference the pre-formatted text from the created variables.

Kind regards,
Bill

Hi Bill! Thank you for the help, though my instance does not seem to have access to the 'create variable' OR the 'Lookup Issues' actions. (I might not be on Jira Cloud, I'm not certain, which is perhaps why)

And as this email will occasionally be sent to people who do not have access to the dashboard I am pulling from, the dashboard would not be an ideal option.

Good news, It is extremely unlikely that this email will contain more than 100 issues. 

Currently, I am attempting to write a ScriptRunner script to send the email, though this is slow-moving. 

Would there be any way in 'Server Jira' to create those variables that I can use for an email automation action?

Short answer, probably not for Jira Server/Data Center...

My understanding is Server/Data Center versions' automation rules do not support Lookup Issues or Created Variables yet.

The equivalent in Server/Data Center for Lookup Issues is the bulk handling feature of branches and scheduled triggers: https://confluence.atlassian.com/automation/bulk-handling-of-issues-993924653.html  That would not seem to help your use case as: you can only have one set of {{issues}} at a time, and there is no place to store intermediate results easily (like created variables)  A complicated work-around would be to store the intermediate results from a branch/JQL in a known issue's custom fields, repeat branches as needed, call the re-fetch action, and then use those custom fields in the email.  (I know...quite messy.)

Other work-arounds could be:

  • buy a marketplace addon for reporting improvements
  • use automation rules (or subscribed filters) to send yourself multiple emails, and use email tool rules to forward them to the recipients
  • build something by calling the REST API and programming tools

Sorry I could not be of more help for your Jira version.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira Software

Upcoming changes to epic fields in company-managed projects

👋 Hi there Jira Community! A few months ago we shared with you plans around renaming epics in your company-managed projects. As part of these changes, we highlighted upcoming changes to epics on...

14,817 views 37 48
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you