Send a list of issues in Slack with Jira automation’s newest action (Cloud)

Hey there, Atlassian Community! We’ve heard a lot of feedback from you over the years around the idea of automating actions on a group of issues. Here are some of the things we heard you wanted to do:

Well, we want you to know we’ve been listening.

Based on your feedback, we’ve added a new action called Lookup issues. Long story short, it allows you to search for a bunch of issues, save it as a list, and then do stuff with it.

Sound good? Let’s dive in and take a look!

 

Recap - What is an automation rule?

At a basic level, Automation rules in Jira consist of 3 types of components you can configure:

  • Trigger - the event that will make your rule start

  • Conditions - requirements that have to be met, for your rule to run

  • Actions - the things your rule will do, if it gets triggered and meets all the conditions

In this article, we’re focusing on a brand new action called Lookup issues.

 

What is the Lookup issues action?

Once your rule is triggered, the Lookup issues action will perform a JQL search that you enter. You can edit your JQL as much as you like so it only searches for the issues you want to include.

Lookup-issues.png

You can then access the resulting list using the {{lookupIssues}} smart value.

 

What could I do with this?

So in short, the Lookup issues action lets you search for issues, save it to a list, and then do stuff with that list. "Stuff" could mean sending an email, Slack, or MS Teams message. It could also mean commenting, transitioning, or updating every issue in the list. Magic!

Let’s look at an example in context.

 

Example: Print all the issues remaining in a sprint

Let’s say you’re a team lead, and you want to update your team every morning on how much work is remaining. Instead of doing this manually, you could set up an automation rule and let Jira automation handle it for you.

 

Step 1: Trigger

All rules start with a trigger; let’s set ours to trigger every day using the Scheduled trigger.

Lookup-issues-Trigger.png

Step 2: Use the Lookup issues action

This is where our new friend, the Lookup issues action, comes in handy. We can enter a JQL query to find all the issues that are in the sprint, and not Done. This list of issues will be saved to the {{lookupIssues}} smart value.

Lookup-issues-Lookupissues.png

Step 3: Have Jira send a slack message containing the list of issues.

Now, we can take that JQL search we just entered, and print the list of issues somewhere using the {{lookupissues}} smart value.

We’ll go with a Slack message for this example.

Lookup-issues-Slack-message.png

Cool! What else could I do with this?

Actually, there’s a lot you could do. For example, you could use Lookup issues to:

  • Take all the issues assigned to one person, and reassign them to someone else (handy for when team members go on holiday!).

  • Look up all the issues that are in a Review status, and add a comment to each one to remind the reviewer to look at them.

  • Compile release notes by finding all the issues in a release, and publishing the summary for each issue.

Really, listing out every possibility here would make this article super long - but I’m sure you’ve already got some ideas for your team! If you’re keen to hear from other ideas, check out our most recent webinar.

 

Where can I learn more?

If you’re excited to jump in and start creating your own rules, head to Project settings Automation to create project rules or Jira settings > System > Automation to create rules for your entire site

Or if you want to learn more:

53 comments

cendre June 24, 2020

Hello

Thank for this wonderfull feature, but I can't find it ? (I have the automation v7.1.15 on Jira server 8.5.3)

2020-06-24_11h28_32.pngRegards

John McKiernan
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 28, 2020

Hi @cendre ,

This new feature is unfortunately only available for the Cloud version of Jira automation right now (as opposed to the Automation for Jira app) 

John 

Neetu Verma July 15, 2020

Hi,

I would like to send more information in my email, for example, Assignee or Status of the ticket. Is that possible

I tried this, but it didnt work. I only get URL for each ticket but not status

{{#lookupIssues}}
https://stptech.atlassian.net/browse/{{key}}- {{issue.status}}
{{/}}

 

Thanks

Neetu

Sven Bendel July 16, 2020

How can I check for the returned list being empty and then abort the action? I want to remind people about open issues and it doesn't make sense to interrupt their workflow with a message saying that there is nothing to do...

Like Yulia Zhyliaieva likes this
Sven Bendel July 16, 2020

@Neetu Verma You can do something like this:

 

{{#lookupIssues}}
{{url}} {{status}}
{{/}}
Like Jibu Chacko likes this
Neetu Verma July 16, 2020

Thank you for getting back to me, But when I add status it comes with status id. I need a status name in the email. How can we do that?

 

for example , 10415 is "status"

https://stptech.atlassian.net/browse/TECH-11504 10415 TECH-11504 STP - Report Builder - ControlOps Datasource 

Sven Bendel July 16, 2020

@Neetu Verma Can you try this?

{{status.name}}
Like Neetu Verma likes this
Darrin Lange July 16, 2020

This is working well. Where can I find the rest of the fields (i.e., summary)?

Neetu Verma July 16, 2020

Thank you, it worked.. Thank you so much 

| https://stptech.atlassian.net/browse/TECH-11504 | TECH-11504 | STP - Report Builder - ControlOps Datasource | In Release Env

@darrin - Here is how I have my rule

{{#lookupIssues}}
{{issueType}} | {{url}} | {{key}} | {{summary}} | {{status.name}}
{{/}}

Sven Bendel July 17, 2020

@Darrin Lange You can find a short list here and additional fields here (see "issue").

Tom Williams
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.
July 20, 2020

Hey @Kevin Bui 

I'm unable to print custom fields in a slack message from the lookup issues action is this a limitation?

I've tried the following combinations following {{#lookupissues}}

  1. {{Story Points}}
  2. {{customfield_10022}}
  3. {{issue.customfield_10022}}
  4. {{issue.customfield_10022.value}}
  5. {{issue.fields.customfield_10022}}
  6. {{issue.fields.customfield_10022.value}}

other info - single project rule, custom field is a numerical field, all fields returned in the lookup issues function have the custom field and its not empty. 

Thanks

T. 

John McKiernan
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 20, 2020

Hey @Tom Williams ,

At the moment, unfortunately you can't use custom fields with the lookup issues action though there is an issue to make this possible. I'll make sure to update this post once that is shipped :)

Cheers,

John 

Like # people like this
blemasle July 22, 2020

Could you please explain how to achieve one of your example : "Compile release notes by finding all the issues in a release, and publishing the summary for each issue."? Without the ability to use smartValues in the JQL, I cannot see how to achieve that...

 

Without that ability, this seems almost useless. Currently, the JQL must be a constant, which I guess is the reason why the example listed on this page is based on a Scheduled trigger : this is the only one that makes sense with a constant JQL... :(

 

And it cannot be achieved by branch rule given that https://confluence.atlassian.com/automation/bulk-handling-of-issues-993924653.html#Bulkhandlingofissues-Bulkhandlingofrelatedissues does not seems to be possible on Jira Cloud :/ 

José Blanco Villalba July 24, 2020

Hi,

I’m having problems with some smart fields when using “Send email”.

This

{{#lookupIssues}}{{key}}, {{/}}

 provides a list of issue keys as expected.

But this

{{#lookupIssues}}{{priority.name}}, {{/}}

provides a list of blank values (“, , , , , , , , ,”). The same thing happens with {{priority.iconUrl}}, {{duedate}} and {{duedate.jiraDate}}.

Does anyone know what the problem may be? I’m using Jira Cloud.

Thanks,
José

Tom Wilson July 24, 2020

Also looking for same thing as Sven..
How can I check for the returned list being empty and then abort the action?
Want to skip sending out message if nothing is in list.  This is awesome!
Have this message going into slack now!!

Release Completed {{version.name}}
{{version.description}}


{{#lookupIssues}}
* {{issueType}} <{{url}}|{{key}}>: {{summary}} [{{assignee.displayName}}]
{{/}}
Justin Freeman July 25, 2020

When will this feature be released for Jira Server?

José Blanco Villalba July 27, 2020

Hi @Tom Wilson and @Sven Bendel

You can avoid sending the message by adding an If Condition before the Send Message block. Choose "Advanced compare condition" within the "If block" and set the condition {{lookupIssues.size}} greater than 0.

Best regards,
José

Like # people like this
Sven Bendel July 27, 2020

That works perfectly, many thanks @José Blanco Villalba !!!

Tom Williams
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.
July 27, 2020

@José Blanco Villalba - that's great!

Now we'd just like to be able to print the {{lookupissues.size}} in the Slack message. Has anyone found a way to do this? 

blemasle July 29, 2020

@José Blanco Villalba 

How do use the `{{lookupIssues}}` to output the release changelog given that you cannot filter on the version just released as lookup issue doesn't support smartValues ?

 

Release Completed {{version.name}}
{{version.description}}


{{#lookupIssues}}
* {{issueType}} <{{url}}|{{key}}>: {{summary}} [{{assignee.displayName}}]
{{/}}
Sam Harding
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 29, 2020

@blemasle You can use smart values in JQL queries, including the JQL used in lookup issues. So to achieve what you are wanting is a case of using the JQL 'fixVersion = {{version}}' in lookup issues (if you are using a version related trigger), and then your template you are using should be as you are expecting.

Sam Harding
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 29, 2020

@Tom Williams Hi, you can't use the {{lookupIssues.size}} inside the {{#lookupIssues}}{{/}}, but you can use it outside of the list iterator, so you could include the size in your slack message along the lines of

Number of lookup issues: {{lookupIssues.size}}

{{#lookupIssues}}
{{key}} - {{summary}}
{{/}} 

The inability to push the {{lookupIssues.size}} inside the iterator is a limitation at the moment, but something we are looking at solving. 

Sam Harding
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 29, 2020

Hi @José Blanco Villalba the fields priority and duedate aren't currently included in the supported fields for lookup issues (see https://support.atlassian.com/jira-software-cloud/docs/automation-actions/#Automationactions-Lookupissues for the available fields). As we go forward, we are adding more fields into this list, and will update the community as we release more functionality.

Like José Blanco Villalba likes this
Tom Williams
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.
July 30, 2020

Hey @Sam Harding 

I was using {{lookupissues.size}} outside of the iterator function and this doesn't work for me. Whats also strange is that  @José Blanco Villalba  solutions below is also not working now when it was before. Has the {{lookupissues.size}} value changed recently? 

You can avoid sending the message by adding an If Condition before the Send Message block. Choose "Advanced compare condition" within the "If block" and set the condition {{lookupIssues.size}} greater than 0.

Sam Harding
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 30, 2020

Hi @Tom Williams , it looks like there might be a typo in your smart value there, the 'i' in lookupIssues needs the be capitalised, whereas in your comments here it is not. Could you verify if that's also the case in your automation rule configuration? Thanks

Like # people like this

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events