I have an issue that is automatically created in JSM by another tool. This issue always contains a string like this:
Ambiente: XPTO
Serviços: ServiceA, ServiceB, ServiceC
Emissores impactados: XYZ, KUO, BMN
The list of "Serviços" is variable. There can be at least one. The name of de services listed in this field is the same as the name of Services assets.
I created an automation that is supposed to "convert" this string of services and set each one in "Affected Services" field.
So, the first thing I did was to create a branch to iterate each service:

It worked. The result of the action above is an array:
[Service A]
[Service B]
[Service C]
Then, I looked up the object in the Assets:

It also worked.
And then, last I updated the Affected Services field adding the object loaded before:

This is the code above:
{
"update": {
"Affected services" :
[{"set":[
{{#lookupObjects}}
{"id":"{{Service ID}}"}
{{^last}}, {{/}}
{{/}}
]
}]
}
}I found the information above in Atlassian community.
Problem: It seems that the update bellow runs only once, even with the iteration running. I know that the iteration runs asynchronously and I don´t mind the order of the services to be included. But, only one service is included in my list.
I put some logs in the automation, and there are the results:


And here is the issue that was used in the automation above:

As you can see, only one of the three services is included in the list of "Affected Services". In this case, it was the first one, but I tried it so many times and the behaviour is random (sometimes the second, sometimes the last service).
Based on the logs, my assumption is that the "Edit Field" step is running only once. Does anyone knows an alternative to this problem?