Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Sending an email with a list of issues using Automation for Jira Edited

HI.

I was following this guide: 

https://docs.automationforjira.com/issues/bulk-processing.html#smart-value-changes

 

The scheduled trigger is using a JQL to retrieve results.

In my example, there were 6 issues.

I received 6 individual emails instead of 1.

Each email had 1 unique issue in it.

I was expecting 1 email with 6 unique issues.

This is the email content I wrote:

The following issues require QA to R&D:

{{#issues}}
<a href="{{toURL}}">{{key}}</a> by {{assignee.displayName}}

{{/}}

resolved issues

What am I doing wrong?

 

8 answers

1 accepted

Hi @Gil ,

I'm a support analyst of Automation for JIRA Support Team.

Firstyl, it is important to have in mind that the bulk handling of issues or bulk sending e-mails is not available for JIRA Cloud (we have this issue for tracking the development of this feature for Cloud: https://codebarrel.atlassian.net/browse/AUT-888).

So if you are using a JIRA Cloud, you cannot perform that action. And if you are using a JIRA server, you'll need to check the "Process all issues produced by this trigger in bulk" option under your "Scheduled" trigger under "More options", as shown in the image below:

Screen Shot 2019-10-02 at 10.22.04.png

Hope that information helps you.

But please let me know if you got any further questions.

Cheers,

Victor

ok, that explains it. 

we use cloud and don't have that option.

 

Thanks for the info!

@Victor Seger when this will be released?

Like Albert Alemany likes this

@Victor Seger Our team would also love to have the "Process all issues produced by this trigger in bulk" option available in JIRA Cloud as well.

Do you have an ETA for that?

Thanks!

Like Gabriella Klein likes this
Daniel Eads Atlassian Team Apr 30, 2020

Hey all,

The feature request for bulk processing of issues in Cloud was transitioned from "Backlog" to "In Progress" on April 22. We're hoping to have this available soon, as noted in this recent article 79 Questions and Answers about Jira Automation .

If you want to keep a closer eye on the progress of this feature, you can see its current status on this issue: AUT-888 

Cheers,
Daniel

Like # people like this
John Funk Community Leader May 01, 2020

Awesome - thanks, @Daniel Eads !! Is there any way to be a Watcher on that to get updates automatically?

Daniel Eads Atlassian Team May 14, 2020

The Codebarrel Jira from before the merger into Atlassian (AUT tickets) doesn't have watching enabled. Any new bugs or feature requests around Automation are being filed in jira.atlassian.com now. The team is moving pretty quickly through the AUT tickets, so there will be less of these over time and the ones that you see most frequently around Community now are likely the ones to be closed out first.

Like John Funk likes this

Hi @John Funk , @Albert Alemany , @qais_alkhateeb 

I just noticed AUT-888 was moved to "Done" today - just for your information :)

Ste

Like John Funk likes this
sreuter Atlassian Team Jun 02, 2020

The feature is now in production, you can search for "lookup" in available actions! More documentation following soon!

Like John Funk likes this

Thanks for the update. In the meantime I'm using JQL subscriptions.

sreuter Atlassian Team Jun 02, 2020

No worries! Here's an example for you if you wanna try it right away:

1. Setup scheduled trigger

2. Select "Lookup issues" as the action and put in your JQL

3. Setup email action which can now access the data from the looked up issues (example is from when using "release version" trigger)...

Subject:

So much goodness, we just released awesome app v{{version}}

Content:

<ul>
{{#lookupIssues}}
<li>{{key}} - {{summary}}</li>
{{/}}
</ul>
Like Gil likes this

Thanks. That's quite helpful!

Is there a way to use that to pass a list of issues in a Slack message?

Like sreuter likes this

Right now it only puts the issue.key in the body if I use {{lookupIssues}}.

sreuter Atlassian Team Jun 03, 2020

@Gil Yes, you can achieve this by adopting like the example above for your purpose.

@Tom De Blende Did you see the example above? The # is important when using the smart value provided by the lookup issue action step.

Like Gil likes this

Thanks @sreuter 

Last thing, for JSD and SLA, is it possible to access the Time to Resolution in the list and present how many hours/minutes left to breach SLA?

Example:

{{#lookupIssues}}
• {{key}} - {{summary}} - in {{"Time to resolution"}}
{{/}}

In my case the TTR is:

customfield_12230": {"id": "1","name": "Time to resolution",

I'm not able to make it work.

@sreuter Works like a charm! Thanks!

Like sreuter likes this
sreuter Atlassian Team Jun 04, 2020

@Gil How does your smart value look like to access the customfield?

I used the customfield variable as a smart value but that didn't work. It didn't list how many hours to breach SLA.

@Victor Seger @sreuter This works great. However: how can I abort an automation if lookupIssues is empty before sending out a message? I wasn't able to create a working size check on this.

JRACLOUD-75698 raised by support to add the bulk feature back on a scheduled automation folks, if you would like to watch/vote. 

While LookupIssues is useful, if it finds no issues it will cause the automation to error, which can be undesirable and noisy. 

By contrast, using the JQL constraint on a scheduled task will pass the automation, with "no actions performed". 

Like Sven, we would like to be able to assess the return without the automation failing. Thanks!

 

 

@sreuter I think there's a bug with the list function.

I use it in a rule to publish a list of issues, based on some trigger, in an email and slack channel.

The list is being published multiple times, say 20 times in slack and 20 emails, all are the same.

Would love to know if I can get on call with you with remote to share with you the problem as it's too complicated to explain over a text.

 

Thanks,

Gil

Did you ever figure this out? I know this is super old, but what I found is that in the Trigger section of the Scheduled option, there was a checkbox for "Run a JQL search and execute actions for each issue in the query.". If I had this checked, then I got multiple emails. So I unchecked it and captured my result set using an Action called "Lookup Issues". Then I added another action to send the email.

Doing this gave me a single email with a list of issues that I was expecting.

Hi @Gil, do you have the bulk processing option active?

Can't find where to enable it.

Like Jacob Golder likes this
0 votes

This and many other use-cases can now be achieved via the newly release "lookup issues" action. Documentation is available at: https://support.atlassian.com/jira-software-cloud/docs/automation-actions/

Example

1. Setup scheduled trigger

2. Select "Lookup issues" as the action and put in your JQL

3. Setup email action which can now access the data from the looked up issues (example is from when using "release version" trigger)...

Subject:

So much goodness, we just released awesome app v{{version}}

Content:

<ul>
{{#lookupIssues}}
<li>{{key}} - {{summary}}</li>
{{/}}
</ul>

 

John Funk Community Leader Jun 25, 2020

Hi @sreuter  - I tried the above documentation but it is a little misleading. The trigger returned nothing if I used issue. and the name. (Also the documentation has an (INSERT SCREENSHOT HERE) prompt but no screen.  ;-)

So what ended up working for me was this:

<ul>
{{#lookupIssues}}
<li><a href="{{url}}">{{key}} </a> | {{created.longDate}} | {{status.name}}</li>
{{/}}
</ul>

I wanted to also use priority but could never get that to work. It's not in the documentation, but figured it might work since it is a standard field in Jira. Any thoughts there? 

John Funk Community Leader Jul 16, 2020

@sreuter  - any update on this one?

Hi @John Funk

I tried both your smart value suggestion as well as one listed above and I keep receiving blank emails.

The rule says it was successful, and I do receive one saying "Hello!" as my greeting, but no issues are listed even though I show 3 that should. 

Like Rabbit Stoddard likes this

@Lesly Cracchiolo I'd love to help you as I have a few of these automations working correctly with both emails and Slack notifications but I can't really give you any pointers without knowing what your rule looks like or what you're trying to put in the content of your email. Screenshots of those would be useful if you'd like help

Like # people like this
John Funk Community Leader Dec 04, 2020

Agreed - screenshots are super helpful  :-)

John Funk Community Leader Dec 04, 2020

Try putting the word issue in front of created and status {{issue.created.longDate}} and {{issue.status.name}}

I'm having the same problem... I also tried it with {{issue.status.name}} and all and it didn't work. But it looks like it's all set up right: 

Screenshot 2021-02-16 142244.pngAnd this below is the email I'm getting:

 

Screenshot 2021-02-16 142258.pngAnd this is the log with the results of the query:Screenshot 2021-02-16 142319.png

 

Any ideas?

John Funk Community Leader Feb 16, 2021

Looks like you are missing the <ul> part

This is what works for me:

{{#lookupIssues}}
* <a href={{url}}>{{key}}</a>: {{summary}} -- {{Story point estimate}} points ({{status.name}}, {{assignee.displayName}})
{{/}}
Like Gil likes this

Anyone who's following this thread, there's a bug with the Lookup action.

It re-iterates on itself and will publish the same notification multiple times.

Say you have a list that contains 3 items, using the Lookup action, if you post a slack message or an email, it will send 3 notifications containing the 3 items.

A 2nd bug is that the Lookup will cause notifications to be published even if the list is empty.

 

I found a really dodgy workaround for my use case.

I wanted to notify my team via slack when Jira issues are stuck In Review for more than 24 hours. Post a slack message with the list of the Jira issues and Flag those issues. If no Jira issues are found, don't post anything.

Using the Branch function and IF conditions are helping.

image.png

Notice how I have to repeat the JQL for this to work.

Instead of using the JQL with the cron. If you use the JQL with the cron, you'll get that issue I mentioned.

John Funk Community Leader Sep 30, 2020

Thanks for sharing @Gil ! How are you populating "status time"?

Hi @John Funk 

It's a custom field I created in Jira.

I then use another automation rule to populate it with {{now}} each time a jira issue is transitioned to some status.

This allows me to count the time a given issue is in a given status.

I use this field quite extensively in many other automation rules and I don't understand why it's not baked in Jira.

The Updated field is not good for my usage because any change which is not a transition, re-stamps the time value in that field.

Hope it helps.

Like John Funk likes this

@Gil Neither of these are bugs with lookup issues. They're problems with your rule. If you were using the JQL with your CRON as described that would explain why you were getting multiple notifications because it then runs for each issue returned. There's no need to run the CRON with JQL, just run without and immediately do lookupIssues.

As for it sending a notification even when lookupIssues is empty, that's down to the fact that you are blindly throwing it into your Slack notification. If you don't want it to do that you need to add a condition before sending your Slack message. In one of my rules I send a different message when there are no issues or you could just choose to do nothing. If you just add an advanced compare condition looking for {{lookupIssues.size}} is greater than 0 before your Slack notification, that will do the trick.

As you clearly want to do two different things here (slack notification of a list and flagging each issue) I'd suggest that you either split it into two automation rules or you could just move the lookupIssues portion to the top (with no JQL in the CRON). So long as it's before your branch rule it should only trigger once.

I'm not sure why you've added the comparison on the same JQL you're using in your lookupIssues. Were you trying to check if there are issues returned? If that's the case, use the comparison I specified above after lookup issues but before your Slack notification

Hi mate, thanks for the detailed reply. I figured where I was wrong with the help of A4J great support.

Your comments are on point.

Hi everyone,

I'm running into an issue using this feature as well. 

I have tried every variation of the {{lookupIssues}} templates shared on this thread, yet the body of the email always comes up empty.

Any assistance getting this bulk email rule to work would be greatly appreciated!

Thanks!Screenshot from 2021-04-30 15-36-05.pngScreenshot from 2021-04-30 15-36-18.png

Hi @Allison ,

Looks like you're close - you just need to add the actual lookup action as a component in your actions before trying to send the email.

I've taken the screenshot below from the "Post weekly MS Teams message with all newly created issues in Jira" rule in the Automation playground that you can use as a reference for what we're talking about here.

In your current rule, you've got a JQL search in your "When" trigger. This runs the rule each time for all the issues that turn up in the search. If the search matches 20 issues, it will try to run the actions 20 times.

What you want to do is add a Lookup Issues action between your "When: Scheduled" and "Then: Send email" components. This Lookup Issues rule will actually populate the {{lookupIssues}} array that is used in the email:

image.png

This also means that you can remove the JQL search from the "When" component, as you'll actually be fetching the issues as part of the Lookup Issues component.

 

Let me know if you're able to get that modified and working, or still need some assistance!

Cheers,
Daniel | Atlassian Support

Daniel Eads Atlassian Team Apr 30, 2021

Disregard - I see you've also opened a separate question where you mention you're on Server and the Lookup Issues action is only for Cloud. Looks like Bill was able to help you out on that question. Cheers!

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase

The benefits of using Jira in different departments

Jira is a great tool to use across different departments. Forget that paperwork – switch to Jira and get that tasks done smoothly. Marketing Jira allows for a complete digital transformation of you...

36 views 0 2
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