Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Automation - Use smart value inside list iterator

Michael Parker April 26, 2022

At the end of a sprint, i want to send a slack message summarising how many tickets of each type were completed. This is to track how much time we're spending on technical debt per sprint compared to feature work.

So far I have created the workflow: On Sprint Complete -> Issue Lookup (get issues completed this sprint) -> send slack message..  now I'm trying to write the code in here.

Ideally I'd be able to iterate through the issue types (e.g. Story, Bug...) then filter the full list of completed issues for each issue type, something like:

{{#lookupIssues.issueType.distinct}}
{{#lookupIssues}}
{{#if(equals(issue.issueType, issueType))}}
Found match! (output something here)
{{/}}
{{/}}
{{/}}

This has nested list iterations, which I'm unsure is supported?

Then I tried the branching strategy -> With advanced branching after the issue lookup, I can set a smart value with varIssueType={{lookupIssues.issueType.distinct}}, then I'm trying to write code something like:

Branch on {{varIssueType}}:
{{#lookupIssues}}
Issue key is {{key}} but {{varIssueType}} doesnt work here!
{{/}}

It looks like smart values from branches don't work inside list iterators either?

Is there another way of doing this?

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.
April 26, 2022

Hi @Michael Parker 

Nested list iterators (and filtering) are possible only when you have lists within lists.  Otherwise I find you cannot perform the inner functions on {{.}} as it has not attributes to name the smart values.

Instead perhaps consider:

  • defining what you want to message, 
  • use a single lookup with filters (or multiple lookups),
  • store the results in created variables, and
  • then aggregate the results for your message.

Kind regards,
Bill

Suggest an answer

Log in or Sign up to answer