Given a trigger, Field Value Changed, I want to create a Smart Value (Create Variable) containing a string of filtered label values (label starts with 'team/').
Example:
Issue
- Labels: team/abc team/def another-label
Expected Result: Variable contains
team/abc team/def
I tried the following:
{{#labels}}{{#if({{.}}.startsWith("team/"))}}{{.}} {{/}}{{/}}
Error: Could not extract smart value parameter: {{.: {{#labels}}{{#if({{.}}.startsWith("team/"))}}{{.}}{{/}}{{/}}
{{#if(issue.labels.startsWith("team/"))}}{{.}} {{/}}
Result: Variable is empty
This works:
{{#labels}}{{.}} {{/}}
But returns all the labels.
I know I am close, but the #IF is tripping me up.
Hi @Rick Moerloos , I'm working off of this article:
https://community.atlassian.com/t5/Automation-articles/Filtering-smart-value-lists/ba-p/1827588
and this reference: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-lists/
I think what you want is:
{{#issue.labels}}
{{#if(startsWith("team/")) }}{{.}}{{/}}
{{/}}
(The trick here is that each label will automatically get iterated through by the IF, so you don't need to include it as {{.}})
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.