I am trying to create an automation that will send an email out that contains multiple tables in it.
For example I want to gather the total number of tickets created in the specified project within the last 24 hours and from that data I would like to be able to create multiple tables based on specific values/fields contained with in those tickets
I already have an automation set up to perform a look up and report out all tickets in an email but the granularity of the tables is what I am struggling with
I am working with Jira Server
Example of what I would like the results to look like:
Hello @Zach
Welcome to the community..
You need to use list iteration and conditional statements to make it work..
I havent tested below syntax, but this is how I usually solve it.. Notice the bolded part, thats how you you can filter each block of your table.
Below will be the criteria in your case for example:
{{#issues}}{{#if(equals(issueType.name, "Type A"))}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Here is what i have an its populating an error "Error rendering smart-values when executing this rule:"
<h3><h3>Daily New Issue Report</h3>
<p><b>Total Tickets</b>: {{lookupIssues.size}}</p>
<p><b>Type A Tickets </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">Reporter</th>
<th style="width:1000px">Summary</th>
</tr>{{#lookupIssues}}{{#if(equals(issueType.name, "Type A"))}}
<tr>
<td><a href="{{url}}">{{Key}}</a></td>
<td>{{fields.issuetype.name}}</td>
<td>{{reporter.displayName}}</td>
<td>{{summary}}</td>
</tr>
{{/}}</table>
<p><b>Type B Tickets </b></p>
<table border="1">
<tr>
<th style="width:100px">Key</th>
<th style="width:150px">Issue Type</th>
<th style="width:150px">Reporter</th>
<th style="width:1000px">Summary</th>
</tr>{{#lookupIssues}}{{#if(equals(issueType.name, "Type B"))}}
<tr>
<td><a href="{{url}}">{{Key}}</a></td>
<td>{{fields.issuetype.name}}</td>
<td>{{reporter.displayName}}</td>
<td>{{summary}}</td>
</tr>
{{/}}</table>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Zach
Couple of things:
lookupIssues in Server/Data Center does not expose all fields. In my test, issuetype.name is one of them. So you need to confirm that all the fields you want are available by logging them before using them in your email. If you are not able to log {{lookupIssues.issueType.name}} you are limited to using JQL in the scheduled trigger and reference {{issues}} from that results instead of lookup.
Second is that, you are missing closing tags in each block.. (highlighted)
<table border="1">
<tr>
<th style="width:100px">Key</th>
<th style="width:150px">Issue Type</th>
<th style="width:150px">Reporter</th>
<th style="width:1000px">Summary</th>
</tr>
<tr> {{#issues}}{{#if(equals(issueType.name, "Story"))}}
<td><a href="{{url}}">{{Key}}</a></td>
<td>{{fields.issuetype.name}}</td>
<td>{{reporter.displayName}}</td>
<td>{{summary}}</td>
</tr>
{{/}}{{/}}</table>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok, yeah i scrapped the lookup action, switched to a scheduled jql and added the closing tag. It started to produce the results I'm looking for. I was able to create 2 tables that are unique based on issue type. I just need to finish cleaning it up so it displays how i want. Thank you for your help!
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.