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

Conditional Formatting of Issue List

Darryl Lee
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 18, 2023

So I have a scheduled job that does a search, and returns the list of issues in:

{{#issues}}

The JQL query sorts by Component, and what we'd love to do is send a weekly email report of issues separated out by Component.

It currently looks like this:

Screenshot 2023-05-18 at 11.06.09 AM.png

And what I'd really like is for all of the Workday tickets to be together under a single Workday header.

I've thought about some check whether {{components}} for an issue the same as the immediately prior issue, and if so, don't display it again; otherwise, display it.

But I think without a way to store a variable while iterating through a list, this isn't really possible.

Help me Obi-Wan @Bill Sheboy and @John Funk you're my only hope. (Yeah yeah, May 4th was a few weeks ago.)

1 answer

0 votes
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 19, 2023

Hi @Darryl Lee 

First thing, I do not have Jira Server, and so cannot test this...

I recently saw from another community post that smart value, list filtering does appear to work with the Server version of automation rules.  As you already have the full list in {{issues}} you could try using a list filter for each component section in the email.

Kind regards,
Bill

Darryl Lee
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 19, 2023

Thanks Bill!

So my thinking was that the logic for this would probably be the same from Jira Cloud to Server.

And yes, a list filter seems like the right way, but I keep thinking I need a way to set a variable to keep track of what the "previous" component was, so something like:

{{#issue}}
{{#if(not(equals(components.name, previouscomponent))}}
<tr style="vertical-align:baseline"><th colspan="2" style="text-align:left" width="80%" bgcolor="#843abc"><font color="white">{{components.name}}</font></th>
{{HERE IS WHERE I WOULD NEED TO SET previouscomponent = components.name}}
{{/}}
DISPLAY OTHER FIELDS
{{/}}

Darryl Lee
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 19, 2023

Sigh, this hackery did not work:

{{#issues}}

{{#if(not(equals(components.name, issues.get(index.minus(1)).components.name)))}}
COMPONENT SECTION: {{components.name}}
{{/}}

{{/}}

OH duh, I'm *inside* of the #issues iteration and so there's no way to reference a "global" smart value like issues.get(index.minus(1)), is there?

Oh man @Bill Sheboy I feel like this is related to this oldie but goodie:

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

My experimentation/usage indicates once inside of an iterator, scope is quite limited.  Specifically, and as you found...once inside an iterator:

  • the list itself cannot be referenced, and more generally...
  • fields in an issue at a higher scope cannot be referenced
  • created variables cannot be referenced

I have seen posts from a few Atlassian staff confirming this limitation.

Why are you trying to access the the "previous" component?  Is that to make this listing by component dynamic?  If so, that may not be possible yet.

Darryl Lee
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 24, 2023

Hi Bill - yep, I wanted the listing to be separated by Components, so there would be a section for Netsuite issues, another section for Workday issues, and so on.

Ah well... just wanted to spitball it. Thanks!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events