Hi,
I'm trying to create an automation rule that updates a parent issue's multi-select list field with the values that are in the same field as the child issues.
For example:
Story 1 (child) -> field multi: a, b
Story 2 (child) -> field multi: c
Story 3 (child) -> field multi: b, c
---
Epic (parent) -> field multi: a, b, c
I've already created a rule that executes every time the ‘multi’ field is changed, I've managed to fetch all the values of the field that are in the child issues and create a list with the different values, however I have problems updating the parent issue with these values.
I'm using a company-managed project for this.
My rule:
My field name 'multi' is a multi-select list present in all my issues.
In my rule i'm creating a varaible with the parent key from the trigger issue to create the lookup issues
Then i create another variable with the list of distinct values from the field 'multi' in my lookup issues usins this formula
{{lookupIssues.multi.value.join(",").remove("[").remove("]").replace(", ",",").split(",").distinct}}
Audit logs
The difficulty I'm having is completing the update of the field in the parent issue. Can anyone help me?
Regards,
Luis
Hi @LuisPinto
Just to confirm, is the parent's field a multiple-select option field?
If so, the rule could use a dynamic JSON expression (rather than selecting the field from the Edit Issues dropdown list), and built using list iteration.
For example, the JSON could be this based on the rule you show:
{
"fields": {
"customfield_12345": [
{{#listValues.split(", ")}}
{ "add": { "value": "{{.}}" } } {{^last}}, {{/}}
{{/}}
]
}
}
Please update to use your specific custom field ID, and ensure the values exactly match the ones in your field configuration.
Kind regards,
Bill
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.