I would like to write one automation rule of 3 categories of Labels.. My JQL will fetch all 3 categories of Labels in Single JQL Query.. So, for all good. In Jira Automation rule, can I use If condition Label = Category 1 in On single Tabular format and 2nd Table Label = Category 2. Finally. Label = Category 3 in 3rd Table... I mean, Key, Summary, Lable 1 is my table Header row.
Please suggest, how do I do this ?
you can use one JQL to fetch the issues of your three different categories and achieve something like you've requested.
After issuing the JQL, e.g. with a Lookup Issues action, you can use a send email action with a template like this:
Table 1:
<table>
{{#lookupIssues}}
{{#if(equals(labels.first, "cat1"))}}
<tr><td>{{key}}</td><td>{{summary}}</td></tr>
{{/}}
{{/}}
</table>
Table 2:
<table>
{{#lookupIssues}}
{{#if(equals(labels.first, "cat2"))}}
<tr><td>{{key}}</td><td>{{summary}}</td></tr>
{{/}}
{{/}}
</table>
Please note that this template only checks the first label in case an issue has multiple ones, I was not sure how to iterate through multiple labels.
Therefore, I'd suggest that you simply create 3 lookupIssues actions and filter them by label in the JQL already. Then you can simply print the result of all these without additional filtering while constructing the email.
Cheers,
Matthias.
Would you please confirm you are using Jira Server, and not Jira Data Center (or Jira Cloud)?
If you are using Jira Server, you will not have the Lookup Issues action which Matthias describes.
Instead you could either user the bulk-handling feature of Jira Server automation, with the {{issues}} smart value substituted where Matthias noted using {{lookupIssues}} ...
Or, use JQL and the Send Web Request action to call the REST API issue search function, using the web response in the same way as the other bulk options.
And one question: can the different labels be assigned to the same issue? If so, what would you expect to happen in the table output?
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Oh, @Bill Sheboy - you're so right. I missed the server tags on this post. 🙈
Thank you for providing some alternatives for the server world.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Greetings Matthias Sir
I really appreciate the great help in this regards. Labels Logic is great !! I fixed it now. It worked the way I wanted.
Most of the time, I was making Syntax and HTML tags incorrectly are killed my time.
The "last" label also works the same way as first label.
Really appreciated your support !!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Greetings Bill Sir
Really appreciated your support !!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.