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:
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.)
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
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
{{/}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
My experimentation/usage indicates once inside of an iterator, scope is quite limited. Specifically, and as you found...once inside an iterator:
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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!
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.