Hello eveybody.
In the proejct I am setting, I have parent and children issues.
I am trying to synchronize a customfield (customfield_10232) between both. Here is an example :
Parent task has three subtasks with the following options selected :
Subt 1 - A,C
Subt 2 - B,C
Subt 3 - E
What I want is that parent task value for the customfield is A,B,C,E.
I thought it would be quite simple with a trigger on the modification of mentioned field, request on children issue and use {{lookupIssues.customfield10232.value}} and then I would just have to branch for the parent and change the value with either simple edition or JSON.
Simple edition does not work (obviously, silly me) and via JSON, I seem to not be able to edit correctly the JSON since it seems to be an array of arrays.
Does somebody have a simpler way to do that or could help me format easily the array please ? It seems quite hard to do and I have not been able to do that until now.
Thanks in advance.
The keys for solving a scenario like this are:
For example, let's assume the child issues are subtasks, and we have used the Lookup Issues action with JQL to gather them. (This will ensure all of the custom field data is loaded, rather than trusting the {{issue.subtasks}} smart value to do so.)
The distinct values from the child issues would be this, using the recently revealed flatten function to help merge the child issue array values:
{{lookupIssues.customfield_10232.value.flatten.distinct}}
With that, the dynamic JSON may be created to update the parent:
{
"fields" : {
"customfield_10232": [
{{#lookupIssues.customfield_10232.value.flatten.distinct}}
{ "value": "{{.}}" } {{^last}},{{/}}
{{/}}
]
}
}
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.