Hey all, this one is really a doozy and I can't figure it out.
User request is to add the values from one asset based field of the child to the parent when child is closed. The issue I have is whatever I do every automation rule fails or clears previus values and does not add new ones.
I have read many the docs and consulted with Atlassian AI, Google AI, ChagtGPT, but all seem to be stuck in a loop.
I have to check the values the parent has and the ones child has and then deduplicate them and try to instert them to the parent - this is because I cannot use a simple "add" operation for Assets-based custom field - meaning: only "set" is supported. This means you can't append values to an Assets field; you can only overwrite the entire field with a new set of values.
Tried different variables/smart values and even changed the rule to be a global one so I could use Lookup objects, which was one of the suggestions.
For example, this is a variable "combinedFeatures" to combine the Features (the name of the assets based field I am trying to copy/add):
{{#triggerIssue.fields.customfield_10196}}{{id}},{{/triggerIssue.fields.customfield_10196}}{{#issue.fields.customfield_10196}}{{id}},{{/issue.fields.customfield_10196}}In debug log I see that it produces:
combinedFeatures: [ { "id": "4046" } , { "id": "4049" } ]And then I am editing the parent field inside a branch with this JSON:
{
"fields": {
"customfield_10196": {{combinedFeatures}}
}
}This example is one of the simpler ones and it is failing with:
(ID 4046 did not have the expected format (customfield_10196))
I had also other ones that had keys instead of ids
combinedFeatures: [ { "key": "INTASSET-4046" } , { "key": "INTASSET-4049" } ]and the rule reported
Issues edited successfully
while it only deleted values from the parent field where it should add them. I have tried many combinations.
Anybody had a similar issue? What would be a solution?