Smart values for copying multiple labels

Kaj Sennelöv December 9, 2021

Hi,

I'm currently working on an automation rule that copies a project code (custom field) and labels from an initiative to an epic.

This is done with smart values (due to different projects etc.) and works great for project code (only one value).
But for the labels, this is an issue when multiple labels are being copied.

In the image below you can see the rule where the value of the label field if the initiative is being copied, currently also logged for debugging purposes, and then normally being pasted in the label field of the epic. but when multiple labels are used they are combined to one value like this: "Label1, Label2". This is an issue for the pasting of that value in the epic label field as a space is not allowed.

How can I separate this value into multiple labels? Or is there a better way to copy this?

Screenshot 2021-12-09 110718.png

1 answer

1 accepted

0 votes
Answer accepted
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.
December 9, 2021

Hi @Kaj Sennelöv 

You are trying this for an initiative and epic, which do not have supported parent/child handling in automation yet (I think)...I know of one way to do this with automation:

Kind regards,
Bill

Kaj Sennelöv December 13, 2021

Hi Bill,

Thank you for your suggestion!
I've tried multiple setups of this, but haven't gotten it to work fully yet.

Also tried with the ".asJsonStringArray" addition when creating the variable, without any luck.

This might though be the way forward, I'm just missing the last bit to format everything nicely I think.

-Kaj

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.
December 13, 2021

Hi @Kaj Sennelöv 

Please try to save your labels from the parent in a created variable (varParentLabels) as this:

{{issue.labels.asJsonStringArray}}

Then when you edit the child to set the labels, you may use this:

{
"fields": {
"labels": {{varParentLabels}}
}
}

If that still does not work, please post an image of your complete rule.  That may provide some context for what is happening in the edit.

Kind regards,
Bill

Like Kalyan Sattaluri likes this
Kaj Sennelöv December 14, 2021

Hi Bill,

I thought I tried this combination, but apparently not.
It works!

 

Thanks again for your suggestion, Bill!

-Kaj

Like # people like this
Kavitha Shellikeri January 10, 2024

@Kaj Sennelöv  can you please post the entire rule, I am facing an issue while copying the specific labels from epic to story, it would be helpful if you can post the entire rule. 

 

Note : Epics are created in different project

Suggest an answer

Log in or Sign up to answer