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.
I recall experimenting with {{index}} within iterators a few years ago, discovering it appears to be a just-in-time attribute of the list iterator and does not exist in a way which permits use in functions, filters, etc.
A possible workaround is to expand the list into another variable with each index, and then use inline filtering with match(). Perhaps like this:
action: create a new variable, which creates a delimited list of index and value pairs
I want to make use of the {{#lookupIssues}} function and use if-condition for further filtering the fetched issues.
Use case:
I want to two lookupIssues lists in a comment or description field.
The first Issue list:
Every fetched issue should be checked whether its "customfield_10110" has the same value as the "customfield_10110" from the current issue, where the automation is triggered from. If it returns TRUE, the issue key should be listed in a bullet point list.
The second issue list should contain all the other issues, where the condition is not met.
FYI: In customfield_10110 we store supplier names. So in other words I want to get a list of other issues, which have the same supplier in the custom field like in the trigger (current) issue.
It seems like I cannot compare a value from the current (trigger) issue with a value of the looked-up issues. The manual triggered automation won't create a comment or post a new description field text.
I tried the following things:
Test 1 – referencing the 2nd compare value (from trigger issue) with a smart value in {{brackets}}
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.
As this is an older thread, I recommend creating a new question and including a link to this thread for context. That will ensure better visibility and focus on your scenario. Otherwise, only people following the older posts will see it.
Until we see your new question...
Long-format iterators have a known limitation where they cannot "see" data from outside their scope. And so once inside those {{#lookupIssues}} ... {{/}} iterators, they cannot access other issues, variables, etc.
There are two possible workarounds for your scenario:
Add your criteria to the JQL for the lookup action, and store the resulting keys in a variable (or lookup table) for later use. Then repeat those steps for each lookup needed.
To use a single lookup work item action, use the dynamic searching methods described throughout this thread, or in this article I wrote on the method.
29 comments