How can I isolate specific issue types to a table from a single JQL search
Asked by Zach:

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

<br />

![MultipleIssueTypesTable.PNG](/t5/image/serverpage/image-id/321948iAA035B3B3FF111EC/image-size/large?v=v2&px=999 "MultipleIssueTypesTable.PNG")


Answers:
author: Kalyan Sattaluri
body: Hello [@Zach](/t5/user/viewprofilepage/user-id/5488954)

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.

comments: author: Zach
body: 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


author: Zach
body: [@Kalyan Sattaluri](/t5/user/viewprofilepage/user-id/5312306) 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")))}}**


author: Kalyan Sattaluri
body: 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\>*

{{/}}

{{/}}


author: Kalyan Sattaluri
body: 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>


author: Kalyan Sattaluri
body: Hello [@Zach](/t5/user/viewprofilepage/user-id/5488954)

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


author: Zach
body: 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\>


author: Kalyan Sattaluri
body: 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.


author: Zach
body: The missing bracket fixed it. Thank you


author: Kalyan Sattaluri
body: Hope its truly working and you did not quit out of frustration :p


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


author: Kalyan Sattaluri
body: \*high fives\*


author: Bill Sheboy
body: Hi [@Zach](/t5/user/viewprofilepage/user-id/5488954)

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


Tags: cloud