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

How can I isolate specific issue types to a table from a single JQL search

Zach May 4, 2024

I currently I have an automation setup that runs a scheduled JQL search then an sends an email with an HTML table listing all the issues and specific fields from those issues. 

Current setup (Works as intended)
<table border="1">
<tr>
<th style="width:100px">Key</th>
<th style="width:150px">Issue Type</th>
<th style="width:150px">Assignee</th>
<th style="width:150px">Reporter</th>
<th style="width:1000px">Summary</th>
</tr>{{#Issues}}
<tr>
<td><a href="{{url}}">{{Key}}</a></td>
<td>{{fields.issuetype.name}}</td>
<td>{{assignee.displayName}}</td>
<td>{{reporter.displayName}}</td>
<td>{{summary}}</td>
</tr>
{{/}}</table>

My question is this JQL search can contain multiple issue types, how can I take the results from the search and break it up into multiple tables that only display certain issues types?

 

End goal is something like this example below where I can have the option of having a table dedicated to 1 issue type and a table dedicated to select issues types and exclude the rest.

  • Table 1 = Only Issue Type A
  • Table 2 = Only Issue Type B
  • Table 3 = Only Issue Types C&D


MultipleIssueTypesTable.PNG

2 answers

1 accepted

0 votes
Answer accepted
Kalyan Sattaluri
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.
May 4, 2024

Hello @Zach

Wasnt the earlier syntax working? {{#issues}}{{#if(equals(issueType.name, "Type A"))}}

Please Note - check is case sensitive, Type A != Type a. Please use the right case.

Or, If you are wondering syntax for doing OR check, try below.

<table border="1">
<tr>
<th style="width:100px">Key</th>
<th style="width:150px">Issue Type</th>
<th style="width:150px">Assignee</th>
<th style="width:150px">Reporter</th>
<th style="width:1000px">Summary</th>
</tr>

{{#issues}}

{{#if(or(equals(issueType.name, "Type C"),equals(issueType.name, "Type D")))}}

<tr>
<td><a href="{{url}}">{{Key}}</a></td>
<td>{{fields.issuetype.name}}</td>
<td>{{assignee.displayName}}</td>
<td>{{reporter.displayName}}</td>
<td>{{summary}}</td>
</tr>

{{/}}

{{/}}

</table>

If there is a different issue, please share.

Zach May 4, 2024

Hey Kalyan,

Your answer from before did help but i was getting caught up on having multiple specific issues type on one table (which i don't think i mentioned on the previous post)

{{#if(or(equals(issueType.name, "Type C"),equals(issueType.name, "Type D")))}}

 

This is most likely what i needed

Like Kalyan Sattaluri likes this
Zach May 4, 2024

@Kalyan Sattaluri whats the syntax for excluding issue types?

How can I make this the inverse, everything but Issue Type C and D?

{{#if(or(equals(issueType.name, "Type C"),equals(issueType.name, "Type D")))}}

Kalyan Sattaluri
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.
May 4, 2024

Please try:

{{#issues}}

{{#if(not(or(equals(issueType.name, "Type A"),equals(issueType.name, "Type B"))))}}

<tr>
<td><a href="{{url}}">{{Key}}</a></td>
<td>{{fields.issuetype.name}}</td>
<td>{{assignee.displayName}}</td>
<td>{{reporter.displayName}}</td>
<td>{{summary}}</td>
</tr>

{{/}}

{{/}}

Kalyan Sattaluri
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.
May 4, 2024

Please refer to syntax here for conditional operations. Hope it helps! Thanks.

https://support.atlassian.com/cloud-automation/docs/jira-smart-values-conditional-logic/#not

Kalyan Sattaluri
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.
May 6, 2024

Hello @Zach 

Please accept answer if issue is resolved so it benefits others in the future, if still issues, please share so we can help. Thanks!

Zach May 7, 2024

It still fails

<p><b>All Issue Types except Type A and Type B</b></p>
<style>
table {border-collapse:collapse;}
table, td, th {border:1px solid black;}
table, td, th {font-family: calibri;}
th {background-color: rgb(217,217,217);color:black}
table, td {font-size:90%;height: 25px}
th {font-size:95%;}
td {text-align:center}
</style><table border="1">
<tr>
<th style="width:100px">Key</th>
<th style="width:150px">Issue Type</th>
<th style="width:150px">Assignee</th>
<th style="width:150px">Reporter</th>
<th style="width:1000px">Summary</th>
</tr>

{{#Issues}}

{{#if(not(or(equals(issueType.name, "Issue Type A"),equals(issueType.name, "Issue Type B")))}}
<tr>
<td><a href="{{url}}">{{Key}}</a></td>
<td>{{fields.issuetype.name}}</td>
<td>{{assignee.displayName}}</td>
<td>{{reporter.displayName}}</td>
<td>{{summary}}</td>
</tr>
{{/}}

{{/}}</table>

Kalyan Sattaluri
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.
May 7, 2024

There is a missing ending bracket in your current syntax.

Should be:

{{#if(not(or(equals(issueType.name, "Issue Type A"),equals(issueType.name, "Issue Type B"))))}}

Not:

{{#if(not(or(equals(issueType.name, "Issue Type A"),equals(issueType.name, "Issue Type B")))}}

Also, as I have said, this check is case sensitive.

So, Please pick an issue of "Issue Type A" and log {{issueType.name}} and share screenshot of your audit log to exactly what its called. Issue Type A != Issue type A.

Please share that log statement and also what is the error you are seeing.

Zach May 7, 2024

The missing bracket fixed it. Thank you

Kalyan Sattaluri
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.
May 7, 2024

Hope its truly working and you did not quit out of frustration :p 

Zach May 7, 2024

Haha no, it is actually working :) Thank you for all the help and patience. 

Like Kalyan Sattaluri likes this
Kalyan Sattaluri
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.
May 7, 2024

*high fives*

1 vote
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.
May 4, 2024

Hi @Zach 

Are you using Jira Cloud or Server / Data Center version?

The {{issues}} (note the plural) smart value is only documented to work for Server / Data Center.  For Jira Cloud, please use the Lookup Issues action and {{lookupIssues}} smart value.

Back to your question: please try smart value, list filtering to make those sections by issue type: https://community.atlassian.com/t5/Automation-articles/Filtering-smart-value-lists/ba-p/1827588

Kind regards,
Bill

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events