I would like to copy the Labels from an Initiative to its child Epics.
I get the key of the parent Initiative through {{issue.Parent Link.data.key}}, which gives e.g. ABC-123. But how do I access the Initiative's labels?
Neither {{issue.Parent Link.data.key.labels }} nor {{ABC-123.labels}} is working
{{triggerIssue.Labels}} gives the labels of the Epic, but not from the Initiative, and I would like the rule to run when the Epic is assigned to a new Parent Link (Initiative)
Thanks for the rule image and explanation, Daniel.
To do what you ask, you need to copy the parent's labels to the child epic, as @Melo noted. Here is the step-by-step:
Then please try your rule again. You should not need the Additional Fields, JSON edit for this one.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yeah, I had tried this, but this rule only works for Sub-Tasks, with their parent being a Task or Story (it even says it in the screenshot), but not for Epics and Initiatives:
When I run the rule the audit log says "Can't find issue to copy from labels"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In that case, one work-around is to use a created variable and a branch to save the Initiative's labels and then make the edit.
Please note: if you want empty Initiative Labels to replace the value for the Epic, you'll need to update this rule to handle it, using an if/else condition.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Awesome, thank you, this works when the Initiative has only a single label. When it has multiple it says that the label cant contain spaces, but that is a separate issue.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Daniel,
I'm not sure how the rest of your rule is configured, but can't you use the UI for this one? or maybe {{triggerIssue.label}}
Cheers,
Melo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, and...to what @Melo describes...
Please consider posting an image of your entire rule, including the trigger you are using and describe the issue you expect to trigger it, the initiative or one of the child epics. That will provide the community context to offer suggestions. Thanks!
Best regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Regarding multiple labels in the parent Initiative, that is a bit more complicated, and requires pre-building the labels and using the advanced field edit. For example:
{{#issue.labels}}"{{.}}"{{^last}},{{/}}{{/}}
{
"fields": {
"labels": [{{varParentLabels}}]
}
}
Best regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Bill Sheboy ,
Many thanks for your suggestion, I was able to follow the suggested changes but the only final piece of the puzzle is that existing labels of the EPIC are lost in this aspect and all labels of the Initiative do get copied.
Any suggestion to prevent that?
Thanks,
Sudipto Roy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Sudipto_Roy
You will need to prefix (or concatenate) the existing labels from the epic onto that created variable, and then you can save them all.
Best regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, followed almost the same approach and got it to work.
Thanks for your suggestion and time.
Regards,
Sudipto Roy
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.