Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Managing Parent Checkbox Values Based on Sub-tasks using Automation

Anthony B October 17, 2020

Hello,

 

I recently asked a question around how to manage a Checkbox custom field in a Parent issue, based on looping through all sub-tasks.  See question here I am now looking to do the same thing but on Jira Cloud using the inbuilt Automation feature.

For background;

  • For a Parent issue I have a "Delivery Team(s)" checkbox custom field
  • For a sub-task issue I have a "Delivery Team" radio button custom field
  • Both custom fields have the same possible set of options to choose from

Whenever the Delivery Team field is updated in the sub-task I want this to trigger a rule for the "Delivery Team(s) field in the Parent to be first cleared and then add back in the equivalent options held by each sub-task.

Is it possible to do this with Automation?

I have tried to do something like the following;

Screenshot 2020-10-18 at 02.03.02.png

I was hoping I could reference the parent field and set it with the sub-task value.. but clearly that doesn't work.  Is there anything else that could be done to achieve my goal?

 

Many thanks in advance

2 answers

1 accepted

0 votes
Answer accepted
Anthony B October 19, 2020

I managed to figure it out, with a slight change of direction and using a JSON function. 

So, rather than looping through the sub-tasks as a branch, instead I trigger the automation when a given sub-task is updated / deleted and then use the Parent branch.  In this branch I use a JSON function to turn all of the sub-task values for a given field (in my case "Delivery Team") into an array. 

This then gets fed into the Parent's field (which I reference using the custom field id, to avoid issues down the road with any field name changes).... and it seems to do the trick!

 

{
"fields": {
"customfield_100XX" : {{issue.subtasks.Delivery Team.asJsonObjectArray("value")}}
}
}

 

Screenshot:

Screenshot 2020-10-19 at 17.20.20.png

0 votes
John Funk
Community Champion
October 19, 2020

Hi Anthony,

Not sure this helps much, but I would question the use of the word fields in the advanced section for {{triggerIssue.fields.customfield

Why not just {{triggerIssue.customfield

Anthony B October 19, 2020

Hi @John Funk thanks for responding.  I think I tried both, but ultimately I don't believe you can use a 'smart value' in that particular section - the fields must be explicitly named.  

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events