Hi,
I have a LookupIssues step in my automation rule. I want to extract, from the first (or any) issue in that LookupIssues, the latest (and only Open / Active) Sprint.
I specifically want the name of the Sprint, rather than the end date, start date etc. The names are formatted in a simple manner, e.g. "Sprint 1" "Sprint 2" etc.
Issues in this LookupIssues JQL only ever have one Open Sprint in their Sprint field, but may have many closed Sprints in their Sprint field.
I have tried variations such as;
{{lookupIssues.get(0).sprint.last.name}}; this correctly produces the last in the list
{{lookupIssues.sprint.get(0).name}}; this correctly produces the first in the list
and many other variations that produced nothing at all.
The issue with the two methods above is that they produce the first and last in the list, which is actually unordered (for some reason, despite the sprints never overlapping in time & date, and always being Closed and Opened sequentially one after another). So instead of retrieving the latest (and only Open) Sprint name (e.g. Sprint 12), I retrieve what looks like an arbitrary Sprint name (e.g. Sprint 4).
I have consulted this thread, specifically the Create Variable solution, then attempted to use variations of sprintStates.match. I feel as though this could get somewhere, I had a few variations resulting in [] truncated characters.
Has anyone made progress on fishing out the Sprint name this way, or another way, after encountering the ordering problem / not being able to use .last or .get(0), as mentioned above?
To do that inline, please try this expression with your lookup issues:
{{#lookupIssues.first.sprint}}{{#if(equals(state,"active"))}}{{name}}{{/}}{{/}}
How this works:
Kind regards,
Bill
Bill, I learn so much from you!
I didn't think that state was a property that could be natively accessed in these expressions. That solves the issue perfectly. Thank you and happy holidays :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Glad to help, and thanks for that link to the older post; I updated my answer to that one to simplify the approach in case people find it there.
Happy holidays to you too!
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.