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.
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.
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:
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:
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:
Or does it work in some other mysterious ways? 😅
Any help would be appreciated 🙌
Cheers!
First thing, a disclaimer: I am not using JSM or assets with rules, and so my suggestions are based on what I know about rules and not those products / features of Jira.
Inside the branch, your rule appears to create a variable with the same name twice in a row, although I cannot see the details of the value being set. What is the purpose of those actions?
Until that is clarified...
Please note that branches which could process more than one thing are run in parallel and asynchronously. And there is no guarantee of when the branch will complete, up to the last step of the rule.
What this means is things which happen inside that type of branch stay inside of there, and cease to exist outside of each iteration / loop. The exception is anything written / saved to the cloud. If you are expecting that variable to persist and be updated, that cannot happen.
Kind regards,
Bill
@Bill Sheboy my apologies then for dragging you into this!
Regarding this:
Inside the branch, your rule appears to create a variable with the same name twice in a row, although I cannot see the details of the value being set. What is the purpose of those actions?
In the first action, we just wanted to 'reset' the variable to see how the system will behave. Feel free to ignore this part as I've removed this first Create variable action and left only the 'second' one (stated in original post).
When it comes to this:
What this means is things which happen inside that type of branch stay inside of there, and cease to exist outside of each iteration / loop.
In my case, it seems that variables from different branches somehow overlap (at least that's how I see it) and there is no clear pattern when or how it works. When you have two objects where "Previous owner(s)" are the same people, it works okay. But when they are different users (whether one or multiple), I usually get different results. I've tested multiple iterations where I've changed "Previous owner(s)" values and here are the results: https://koios.atlassian.net/wiki/external/MTk4ZGQyMGJkNmY2NGYyYzg1OTk3ZjlhNzFkNmQ0MDg
One more thing - can you clarify this?
The exception is anything written / saved to the cloud.
Cheers,
Tom
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The values of variables for each iteration / loop of the branch on the AQL are definitely distinct. If the values overlap, that would be related to:
And so the double updates you note are likely caused by the overlap, and the unpredictability of results from the parallel processing nature of loops.
The solution is to somehow adjust those two things above to process each item one time.
About this...
The exception is anything written / saved to the cloud.
If inside of a branch it updates an issue (or object) that persists, stored in the cloud. The other things inside of the branch (e.g. variables created) no longer exist after the branch runs each loop. Sorry if the original post was a bit vague :^)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ugh... I can be such a potato-head sometimes 🤦♂️
Before I added branching/iteration, the action for updating assets/objects was Edit Assets field attributes. As, initially, we only had one asset linked to an issue, that was fine. I forgot to take in consideration that this actually updates all assets in specified Jira field, even if there are multiple objects added.
Once the iteration was added, variable creation and branching was okay, but in each iteration, automation action would update both objects and not only the one from current iteration.
Basically, the only thing I had to do is to replace mentioned action with Edit object attributes (which actually looks current object from branch iteration), and everything worked like a charm.
@Bill Sheboy , thanks for the help here! I needed second pair of eyes and the guidance you provided to resolve this. Much appreciated 😄
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for figuring this out, I was literally just trying to figure out the same thing!
The docs on using Automation with Assets are no where near sufficient.
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.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.