You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.
View groupJoin the community to find out what other Atlassian users are discussing, debating and creating.
Hi
I have a set of Labels in my ticket (a,b,c). In my automation I would like to save my labels in a temporary Variable (New Action > Advanced > Create Variable) and, at some point in the flow, restore these Labels according with conditions.
When I create the Variable I assign the value to a TMPLABEL as per below
{{issue.labels.join(",")}} // comma separated string
or
{{issue.labels.asJsonString.asJsonArray}} // Array
In the Edit Issue step I try with
{
"fields": {
"labels": [
{{#TMPLABEL}}{{.}}, {{/}}
]
}
}
When the automation runs I get the error "Error while parsing additional fields. Not valid JSON."
Any idea?
Thanks
--
Federico
Hi @Federico Zanetti ,
please try
{{issue.labels.asJsonStringArray}}
and
{
"fields": {
"labels": {{#TMPLABEL}}{{.}}{{/}}
}
}
The problem with
{{#TMPLABEL}}{{.}}, {{/}}
is there will be comma after all labels (including the last one) and also the quotes will be missing - so this will result in something like:
label1, label2, label3,
But we need to create:
"label1", "label2", "label3"
I don't like my solution much, but this only combination worked for me.
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.
Hi @Hana Kučerová,
on the same topic, what if I would like to restore a label according with a condition.
For instance, I have three labels "MY_PIZZA, YOUR_PIZZA, MY_CAKE" saved in a Variable and I would to restore just labels including "PIZZA"
Following the example in the documentation, the most reasonable solution seems
{{#if(TMPLABEL.indexOf("_PIZZA").gt(0)) }}
{{.}}
{{/}}
However, when I run the automation, I get an error as per below
Error editing issues (data was not an array (labels))
Any thought?
Thanks
--
Federico
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Federico Zanetti ,
I don't know about your use case much, but wouldn't it be possible to use automation conditions and action (Edit issue -> Labels -> Add/remove values) instead of working with variable? It seems to me very complicated and after some time it will be hard to determine, what is your automation rule exactly doing.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
During my 17 years as a coach, mentor, and trainer of Agile teams, I’ve participated in hundreds of Agile planning meetings. The end result was a wall of backlog items annotated by an explosion of co...
Connect with like-minded Atlassian users at free events near you!
Find an eventConnect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.
Host an eventYou're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.