Hello, I’m trying to set up a Jira automation that does the following:
Type_PI1
Type_PI2
Type_PI3
Type_PI4Type_PI5
If the Epic has any of these labels, perform an action where the child inherits these labels (Epic -> Stories/Tasks -> Subtasks).
Also, if any labels are removed from the parent, they should also be removed from all children.
I’ve had challenges particularly with the point (3), making sure labels removed from the parent actually are removed from the children. For instance, when someone updates the labels in bulk (i.e. user removes Type_1 & Type 2, then changes it to Type_3 & Type 4. The issue history just shows a single “labels changed” entry, which I think makes it hard for automation to detect what was added vs what was removed.
I'm not sure if I need multiple rules here, or a scheduled rule that simply re-syncs children to match the parent rather than relying on the “field changed” trigger.
I don’t mind which approach as the important thing is to have a reliable setup that keeps the labels sync'd.
Has anyone set up something like this or can help me resolve this query please?
Thanks in advance!
Note: Here are a couple of screenshots of a rule I've tried without success. I'm just trying at a Story to Sub-Task for now.
Hi @Daniel Lee
When do you want the labels synched? You show a couple of example rules, where one uses a Scheduled trigger and the the other uses Field Value Changed for the labels.
Next, you note examples of adding / removing labels and of just keeping them aligned. Have you tried rules where they just copy the labels from the parent work item to completely replace them?
Finally, you seem to be describing only update cases. However, there are several others, potentially requiring multiple rules. Please consider which cases you want to cover, as they included at least these:
Some of these cases can be combined to use fewer rules.
Kind regards,
Bill
Hi @Bill Sheboy
This was my initial thinking (but totally ok with being flexible):
For all your 8 x dot points:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for those additional details, @Daniel Lee -- Please note I was listing those other cases to help you consider what / how to handle them...and not as a roadmap to provide you a bunch of rules. I would actually need to implement each one to determine the exact steps, and then post those details.
Short answer: my recommendation is to make one single rule for field changes (or scheduled) which updates children for a specific type of parent. Confirm that works as expected. Only then investigate adding / modifying rules for other cases. Ultimately, it may be easier to use a separate custom field for the Type_PI1..5 values rather than Labels to ensure the separation and synch of the values is accurate.
From what you described...
Updates in "near real-time" may not be fully possible. Yes, you could create a lot of rules to cover the cases and get closer to the current values across the issues, but remember the possible timing / outage / usage limitations.
Another wrinkle you describe is selectivity setting the labels: the parent label values are a superset of what could be in the children. You do not want them to exactly synch from parent to child. This makes solving this much more difficult.
There are known rule defects where when a list field such as Labels change, the rule cannot consistently detect exactly what changed.
A possible workaround would be:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yet again, thanks for your advice @Bill Sheboy
The near real time is the desire but not a strict requirement. I'm sure the program would be ok with there being a delay in favour of a reliable solution.
With regards to the workaround you proposed, do you have an idea of the automation steps and fields.
I have had some success with the 'Add' but not the 'Remove'. (see image below)
Do you see these as being two separate rules?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Well done making progress solving this one!
When updating the work item, I recommend first performing the label deletions, re-fetching, and then adding the correct ones. This prevents racetrack timing problems / collisions in the updates. For example:
For the deletion, your regular expression is missing the group parentheses, so perhaps try this:
{{issue.labels.match("^(Horizon_PI[0-9]+)")}}
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.