Editing assets objects using jira automation
Asked by Daniel Kerr:

Hi everyone,  

I need help with editing assets using Jira automation. I've enrolled in both Atlassian university assets courses (essentials \& advanced), and have found them extremely helpful in learning how to configure our asset management database as well as certain things like how to create new objects via Jira automation. BUT, when it comes to editing existing assets using Jira automation I haven't been able to get anything to work and I feel that I am at a stalemate. For reference, we are on the cloud version of JSM.  

Could someone help me with the following use case that I have below:  

Example of what we are storing in our CMDB:  

- Licenses with their application, application reference, assigned users \& license status (see attributes below)

![Image 1.png](/t5/image/serverpage/image-id/307828i8AA44300D50448C4/image-size/large?v=v2&px=999 "Image 1.png")

![Image 2.png](/t5/image/serverpage/image-id/307831i1AFF9F947E445115/image-size/large?v=v2&px=999 "Image 2.png")

Then I have configured the below Assets field for the test request form so that only available Salesforce licenses are shown on the portal request for a user to select an available license:  

![Image 3.png](/t5/image/serverpage/image-id/307834iC498DBE127A67E62/image-size/large?v=v2&px=999 "Image 3.png")

When raising the request, the available license displays a default value as expected.

![Image 4.png](/t5/image/serverpage/image-id/307835i7D2193F7C028390F/image-size/large?v=v2&px=999 "Image 4.png")

The below automation has been set up to (try) change the license status from "Available" to "Not Available".  

![Image 5.png](/t5/image/serverpage/image-id/307863i80E18C2A733FD5E6/image-size/large?v=v2&px=999 "Image 5.png")

This rule doesn't make any changes when the issue is created, and the status of the selected license remains set to "Available". I also have tried using the "Edit issue fields" action (with \& without the edit attributes action before it), but whatever I put as a value for the edit issue field, I get the below error:  

![Image 7.png](/t5/image/serverpage/image-id/307866iAF1E60C6CF2D6637/image-size/large?v=v2&px=999 "Image 7.png")![Image 8.png](/t5/image/serverpage/image-id/307865i03ACD76985394C9E/image-size/large?v=v2&px=999 "Image 8.png")  

The field will populate with the values entered on the request form onto the ticket but the automation rule will never execute any actions but advise in the audit log that the rule was ran successfully but no issues were found.  

![Image 9.png](/t5/image/serverpage/image-id/307871iEB863BAA19B73E7D/image-size/large?v=v2&px=999 "Image 9.png")

![Image 10.png](/t5/image/serverpage/image-id/307884i2AD7F16198186EB5/image-size/large?v=v2&px=999 "Image 10.png")

Can someone please guide me on where am I going wrong with my automation rules for editing existing objects?   

1. Is there something wrong with how I am configuring my asset's custom field?

2. Should I be using "edit object attributes" or "edit issue fields" or both?

3. With "Edit issue fields" (if I should be using this), what do I need to be storing in my AQL queries to change the status of an object?

4. Finally, once I understood how to configure this, I would look to also update the assigned user as well which is using an object type attribute.

If anyone could provide some assistance with this, I would be extremely grateful.  
Thanks.


Answers:
author: Mikael Sandberg
body: The Edit Object component can only be used on an [AQL branch](https://support.atlassian.com/cloud-automation/docs/jira-automation-branches/#AQL), and you can only create the AQL branch if the rule is created from Global automation.

![Screenshot 2024-02-21 at 10.56.35?AM.png](https://community.atlassian.com/t5/image/serverpage/image-id/307902i3F9902BAE07CB000/image-dimensions/243x194?v=v2 "Screenshot 2024-02-21 at 10.56.35?AM.png")

Edit issue fields only applies to the issue, it cannot be used to edit an object.

What type is the user attribute? User? If it is then you need the Atlassian Id of the user that you want to set it to.


Tags: asset-management

assets

automation

cloud

jira-service-management

jira-service-management-cloud