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

Automation: Custom Fields - Lookup issues not working

Melissa C
Contributor
May 13, 2024

Hello,

I've been using Project Automation for some time, I'm able to send emails using the following (See Below) - We recently got a Jira update and now have the "Lookup Issues" when I compile my automation and apply the name smart values (using {{issues}}) I can not get the custom fields. I'm only able to get Key with an url, Summary, Assignee. 

Is this a limitation of the "lookup Issues" feature?

We use Jira Data Center

<tr>
<td>
<a href="{{epic link.url}}">{{epic link.epic name}}</a> </td>
<td>{{Key}} </td>
<td>{{summary}}</td>
<td><a href="{{epic link.Document Link}}">{{epic link.epic name}}</a><br>
</td>
<td>{{customField_11726}}</td>
<td>{{Assignee.displayName}}</td>
<td>{{Teams Impacted}}</td>
<td>{{Product Line}}</td>
<td>{{Updated.shortDate}}</td>
</tr>

2 answers

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 13, 2024

Hi @Melissa C 

Unfortunately, the Lookup Issues action for Jira Data Center version does not support most fields yet, including custom fields: https://jira.atlassian.com/browse/JIRAAUTOSERVER-877

If it is of any consolation, when Lookup Issues was first added for Jira Cloud, it also only had about a dozen fields, and a year later all of the others were added.  So I recommend watching that suggestion to see any progress.

 

There are two possible workarounds, depending upon what you need to accomplish and your rule structure:

Kind regards,
Bill

Melissa C
Contributor
May 13, 2024

Thanks  @Bill Sheboy 

So disappointing!!! But I'll keep my hopes up!!

What I wanted to do was supper simple, just wanted to email a weekly report that consists of two different tables. Currently I'm running to rules and them combine them in outlook and send it as one. 

 

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 13, 2024

From your response I am guessing you are using Jira Data Center, correct?

Are your two different tables over the same issue set or different sets?

Melissa C
Contributor
May 13, 2024

@Bill Sheboy 

Yes, Data Center

So two tables similar issue set

1st table Epics approved in the last week

2nd table Task closed in the last week

We just got this new upgrade this was so exciting! 

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 13, 2024

Thanks, and to have those two tables handled by a single rule, it could:

  • use a Send Web Request action to call the REST API issue search for the first table
  • preformat the HTML and save the results with a Create Variable action
  • use a second Send Web Request to get the results for the second table
  • send the email, including the preformatted variable and the second results

 

Like Melissa C 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 14, 2024

Hello @Melissa C 

Other than Bill's suggestion, another option is to filter your result set on the fly as needed.

Start with your scheduled trigger where you have {{issues}} which is your complete result set.

Then you can create your tables like below..

Please note the If checks are case sensitive. so Epics != epics. You have to use the right case for checks to pass. Which you can find by logging sample values from an issue.

--------------------------------------------

TABLE 1:

<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, "Epics"),equals(status.name, "Approved")))}}
<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>

 

-------------------------------------

TABLE 2:

<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, "Tasks"),equals(status.name, "Closed")))}}
<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>

------------------------------------------------

NOTE, I suggest you do an If check with JQL before sending email so you dont send empty emails out. so your rule could look like:

  • Trigger = Scheduled with your current JQL criteria
  • Add component -> If/Else condition -> JQL check => issuetype = Epics and status = approved
  • Action send email with Table 1
  • Else -> JQL check => issuetype = Task and status= closed
  • Action send email with Table 2

Or, you can send 1 email with both tables but still do the If check by combining the JQL, that way, as I said, you dont send blank emails.

Refer to recent discussion on similar requirement below:

https://community.atlassian.com/t5/Automation-questions/How-would-one-create-multiple-tables-with-unique-JQL-search-when/qaq-p/2687506

https://community.atlassian.com/t5/Automation-questions/How-can-I-isolate-specific-issue-types-to-a-table-from-a-single/qaq-p/2688979#M10348

Hope it helps.

Melissa C
Contributor
May 20, 2024

@Kalyan Sattaluri 

THANK YOU!!! THANK YOU!!!!

This has been a life saver!  I got my report with the two tables! Thank you!

I've also created a couple of other reports!

I'm stuck on one syntax, do you have any suggestions or links that could be help with coming up with the correct syntax 

I'm wanted to the list to show me all Tasks, that have been closed(resolved) in the last week.  I'm not able to figure out the last part in the last week. Any suggestions?

{{#if(and(equals(issueType.name, "Task"),equals(status.name, "Closed"), and(resolved <= startOfWeek(-1))))}}

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 20, 2024

Hello @Melissa C 

To add additional clauses to your checks, you need to include another if statement, because by default, an if statement will only take 2 paraments to check for OR /AND functions.

Please look at the bolded part below, make changes as per your issue set up and adjust the days check accordingly.


<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(and(equals(issueType.name, "Task"), equals(status.name, "Closed")))}} {{#if(now.diff(resolved).days.gt(-7))}}
<tr>
<td><a href="{{url}}">{{Key}}</a></td>
<td>{{fields.issuetype.name}}</td>
<td>{{assignee.displayName}}</td>
<td>{{reporter.displayName}}</td>
<td>{{resolved}}</td>
</tr>
{{/}}
{{/}}
{{/}}</table>

 

Hope it helps!

0 votes
Mauricio Heberle
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 13, 2024

Try using:

<{{fields.customfield_xxxxx}}>

Melissa C
Contributor
May 13, 2024

@Mauricio Heberle Thanks!

But that doesn't work! So close!!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events