Emailing a list of issues matching a JQL (scheduled)

Andrey Tyupov February 20, 2018

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
andreas
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.
February 20, 2018

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 

Andrey Tyupov February 21, 2018

Thank you!

Andrey Tyupov February 21, 2018

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.

andreas
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.
February 21, 2018

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
Andrey Tyupov March 1, 2018

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
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 20, 2018

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.

Andrey Tyupov February 20, 2018

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
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 5, 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
AUG Leaders

Atlassian Community Events