You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
Hi,
I'm currently exploring the capabilities of automation for Jira to have a hierarchy alignemnt on Components fileds of a group Epic-Story-subtask.
I'm already able to copy components from a parent. Also to add new components when the parent changes (or to replace them).
My current problem is about how to delete a specific component value from the list of compontents of an issue.
The practical example is the following one. But, currently, I'm still not able to delete a specified component.
step1) sub-tasks and stories already inherited Epic components (maybe appending to any already existing)
step2) one component is deleted from a parent issue (let's say the epic)
step3) the same component SHOULD be deleted from the childrens (let's say at lest from the stories under that epic)
I was trying to use smart values/advanced rules/variables to solve step3) but nothing seems to fit my needs.
Could anyone help me?
thank you in advance for the help.
You can remove a component using automation with custom fields and the list, string, advanced JSON edit, and create variable functions. It is a bit messy, so if you want the details of how to try this, please let me know.
Summary of how this works: concatenate the component values into Json, remove the target value, and use the remaining Json to update the component list.
Best regards,
Bill
Hi Bill,
yes it is exactly what i wanted to try, but something is not totally clear to me.
I should to use "additional fields" box into a "edit issue fields". But I never worked with Jsons. I mean, never programming them.
It will be really helpfull to read how to proceed. Could you kindly try to explain me? actually I'm trying to understand recursive concatenation with smart values.
I'm already able to extract the list of the components, separated by comma, before change and after.
Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Here is the information for how I removed a component. Please consider adding logging to see what is happening during the processing.
'{{issue.components.name.split(",").get(2)}}'
{{#issue.components}}{ 'name': '{{name}}'} , {{/}}
{{firstJson.remove(issue.WorkingComponent).remove("{ 'name': } , ").substringBeforeLast(",").replace("'","\"")}}
{
"fields": { "components" : [ {{finalJson}} ] }
}
Here is the documentation on advanced field editing with JSON, the string functions, and the list functions I used:
https://support.atlassian.com/jira-software-cloud/docs/advanced-field-editing-json/
https://support.atlassian.com/jira-software-cloud/docs/smart-values-text-fields/
https://support.atlassian.com/jira-software-cloud/docs/smart-values-lists/
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.
Ciao Bill,
Many thanks for your help. I have to say that it is working!
I'm able to move modified epic components to the children now.
The next step will be to manage any additional component at children level (not present into fathers) But i should have enough info to update also in this direction. Just need the time to think about :)
Best Regards,
Michele
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Michele D'Adamo
Thank you for reaching out.
Indeed, Jira automation does not have a function to remove a component of a child issue (Stories, Sub-task, etc) when it gets removed in the parent issue (Epic or Parent task). We have the following feature request to get this function implemented on the rule triggers, so you would be able to use the Smart values to properly reference it in the rule actions:
Trigger rule when value is added/removed from multi-select type field
You can keep an eye on that feature request to check any updates.
If the child issues should have the exact same components as the parent issues, a possible solution would be to completely override the components of the child issues with the ones selected/removed in the Parent issue:
For more details, you can check the section "Add values to multi-select fields" of the documentation below:
Let us know if you have any questions.
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.