Are you in the loop? Keep up with the latest by making sure you're subscribed to Community Announcements. Just click Watch and select Articles.

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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Jira Automation email for 3 categories of Labels

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 ?

1 answer

1 accepted

0 votes
Answer accepted
Matthias Gaiser _K15t_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Oct 24, 2023

Hi @Sridhar Gandla

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.

Bill Sheboy
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.
Oct 24, 2023

Hi @Sridhar Gandla 

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

Like # people like this
Matthias Gaiser _K15t_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Oct 24, 2023

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.

Like # people like this

I am using Data Center version...

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 !!

Like # people like this

Greetings Bill Sir 

Really appreciated your support !!

Like # people like this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events