Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

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

Emailing a list of issues matching a JQL (scheduled)

Hello,

 

How do place a list of all issues found by an element:

When: scheduled (search by a JQL) into a 'Send Email' element so that the recipient receives a list of issues returned by the JQL?

3 answers

1 accepted

7 votes
Answer accepted

Hi Andrey,

So generally filter subscriptions as @Nic Brough _Adaptavist_ mentioned work well for this.

However if you want to use one of our automation rules for the reasons you described, then please check the 'Process issues in bulk checkbox on the trigger' (this works in server only currently).  That means all issues found by the trigger will be available to the 'Send e-mail' action via the 'issues' smart value (https://docs.codebarrel.io/automation/smart-fields/extracting-issue-data.html).

You could then use something like this to iterate over all issues:

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

This would print a HTML list of key and summaries of the issues in the result set.

Please also check that the rule actor visible in 'Rule details' has the appropriate permissions to browse (see) these issues.

Cheers,
  Andreas 

Andreas, can I have one more question answered?

 

Currently I have set up the following rule:

 

1. When: scheduled. 

- run a JQL search and pass results to subsequent conditions and actions - CHEKCED

- Only include issues that have changed since the last time this rule executed - UNCHECKED

- Process all issues produced by this trigger in bulk - CHECKED

2. Then send mail.

 

How do I make the condition count (JQL query form step 1) > 0? Because now emails are being sent even when the JQL returns 0 issues. And I want them to be sent only in case when there are at least 1 issue.

I can't check the 'Only include issues that have changed since the last time this rule executed' option as I want all the issues that match the search to be present in the email.

Hi Andrey,

Yes this isn't very intuitive yet. https://codebarrel.atlassian.net/browse/AUT-784

For now you can add a 'Compare condition' to your rule and check the following:

  • First value: {{issue}}
  • Does not equals
  • Second value: (empty)

So the idea is that the 'issue' smart value will only be populated if the trigger produced an issue.  So if it's not empty, you have issues!

Cheers,
 Andreas

Like Brooke Miller likes this

Hi Andreas,

I think I need your help again. I am trying to limit the selection of the issue to only those that were created more than a defined amount time ago (say 1 hour).

 

I have inserted a JQL-condition (since Compare Condition doesn't have an option '>' or '<'):

 

{{#issue.created}}{{/}} < {{#now}}func=minusMinutes(60){{/now}}

 

The rule passed the validation however failed during an execution:

 

JQL CONDITION

No subsequent actions were performed since JQL condition did not pass due to error running JQL:Error in the JQL Query: The character '+' is a reserved JQL character. You must enclose it in a string or use the escape '\u002b' instead. (line 1, character 47), Error in the JQL Query: The character '+' is a reserved JQL character. You must enclose it in a string or use the escape '\u002b' instead. (line 1, character 46), Error in the JQL Query: The character '+' is a reserved JQL character. You must enclose it in a string or use the escape '\u002b' instead. (line 1, character 45), Error in the JQL Query: The character '+' is a reserved JQL character. You must enclose it in a string or use the escape '\u002b' instead. (line 1, character 48)

 

Am I doing it wrong?

1 vote

Go to search, and build the filter you want to send.  Save it with a useful name.  Go to the options and use "subscribe", giving it the schedule and user to send it to.

Yes, but then every person needs to subscribe to it. And Automation for Jira allows sending out such emails based on the rules configured. However I can't figure out how to place a list of issues in the email. The trigger works fine, but the email itself is just a text string with no issues inside. I've place {{issue.field.key}} but it results in just blank space in the email.

0 votes
Olga Videc Community Leader Feb 05, 2020

Hello @andreas 

Quick question, 

You original post work's 

But why doesn't this work 

<ul>
{{#issues}}
<li>{{key}} - {{issue.duedate}} - {{issue.toUrl}} </li>
{{/}}
</ul>

BR, Olga 

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Apps & Integrations

🍻🍂Apptoberfest Update: Upcoming Virtual Events 🎉

Hello Community! I hope you've been enjoying the 🍂Apptoberfestivities🍂 (I know I have!) The event is heating up next week with a series of virtual events that we're calling the 🍻🍂Partner App ...

380 views 3 17
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