What are we trying to achieve?
We have employee IT equipment stored inside Assets. On each asset/object, you have an attribute stating current employee/owner of that asset. What our Asset managers would like to 'see' is when they navigate to 'people' object, to see which assets they have previously owned, together with assets they currently own.
Regarding assets they previously owned, the idea is to have additional attribute on each asset pointing to "people" object type that can also store multiple values as asset can be owned by multiple people during its existence.
The setup
We are looking at two object schemas - one for people/users with 1 object type "People", and one for IT assets containing multiple object types (e.g., "Laptops", "Mobile phones"...)
👉Additionally, have an automation in our JSM project which automatically updates current owner (removes the user from the IT asset attribute) once ticket (request type "Return your asset(s)) reaches specific status in a workflow.
The issue
Imagine that the JSM ticket has 2 objects (let's call them Object 1 and Object 2) linked and I'm owner of both of these objects. Both of these objects had previous owners where "Object 1" had Person A as a previous owner and Object 2 had Person B as previous owner.
Now, the automation should do the following - once ticket reaches specific status, remove current owners from both objects (this part works okay), and change the value of Previous owner(s) attribute by only adding "current" owner to the list. So, after the automation is done, we should have something like this:
- Object 1 ("Previous owner(s)"): Person A, Tomislav Tobijas
- Object 2 ("Previous owner(s)"): Person B, Tomislav Tobijas
Automation is using the following solution for appending the values to object attribute: https://confluence.atlassian.com/jirakb/how-to-append-objects-to-an-assets-object-attribute-using-automation-1283493731.html

Now, according to rule logs, created variable is correct upon creating but once it is used in Edit Assets field attribute action, it updates both objects with 'same' values and I end up with the following result:
- Object 1 ("Previous owner(s)"): Person A, Tomislav Tobijas
- Object 2 ("Previous owner(s)"): Person A, Tomislav Tobijas (❌ not ok)

I'm wondering if I'm missing something here? Does the automation and (AQL) branching work in a way that if there are multiple objects inside branch:
- Iteration 1: For object 1 > create variable
- Iteration 1: For object 1 > update attributes
- Iteration 2: For object 2 > create variable
- Iteration 2: For object 2 > update attributes
Or does it work in some other mysterious ways? 😅
Any help would be appreciated 🙌
Cheers!