How to pull Asset attribute data for a specific Asset in automation
Asked by Alex Smyers:

I am running into trouble trying to reference specific asset attributes in automatons in JSM Cloud.

We are using assets to track systems we have and the different access types associated with them. Example, we have Adobe Software which we have identified as a "Service". Adobe Software then has three Access Types, Adobe Acrobat Pro DC, Adobe Captivate, and Adobe Creative Cloud Suite.

We have system access forms created on our request portal for new and existing employees. These forms allow users to select multiple Services. For example an employee could need access to Adobe Software - Adobe Captivate (Service is Adobe Software and Access Type is Adobe Captivate) and Github - Github (Service is Github and Access Type is Github). We are using an automation to create sub-tasks for each Service needing access. My goal is to have the Access Type needed in the description of each sub-task.

I can populate both Service's Access Types easily with {{object.attribute name}} in our case, {{Access Type.Access Type Name}}, however I cannot figure out how to create a condition around this to give me the name of the access type for one system. I do have each service split out to have their own sub-task created with an If: matches JQL condition "Service" = "Service Name" ex "Service" = "Adobe Software" which is working fine.

I've tried all sorts of combinations smart values such as {{Service.Adobe Software.Access Type Name}}, {{Adobe Software. Access Type Name}}, conditional logic with smart values, as well as using the Lookup options action.

Is what I am attempting to try possible? If so, what would be the be the best method to accomplish this.


Answers:
author: Tessa Tuteleers
body: Hi [@Alex Smyers](/t5/user/viewprofilepage/user-id/5568308) ,

Welcome to the community! Fun question!

If I understand correct, you want to:

- Loop over Service (multiple values possible)

- Then get al values from Access Type field associated with that service?

To create your automation, you will need to do the following:

* Loop over your services with a smart value branch -\> very easy: ***{{issue.Service field}}***and name the smart value service -\> now you will be able to branch over the different services in the Service field
  * in that branch (loop), do an AQL lookup to find the matching objects -\>   
    ***key in ({{issue.Access type}}) AND "Service" = {{service}}***   
    This will return all objects in the Access type field, and then limit them to the service in thet specific iteration of the branch
  * Then create a subtasks with whatever info you want to get out of the {{lookup objects}}
    * To iterate over the returned objects, use an inline list in the description field  
      ***{{#lookupObjects}}
      \* {{Name}}
      {{/}}***

It should look something like this:

![Screenshot 2024-08-14 210044.png](https://community.atlassian.com/t5/image/serverpage/image-id/341841i8D64EEE80AB4D438/image-size/large?v=v2&px=999 "Screenshot 2024-08-14 210044.png")![Screenshot 2024-08-14 210123.png](https://community.atlassian.com/t5/image/serverpage/image-id/341842i4CDFAE8B86AD01BD/image-size/large?v=v2&px=999 "Screenshot 2024-08-14 210123.png")![Screenshot 2024-08-14 210128.png](https://community.atlassian.com/t5/image/serverpage/image-id/341840i9015758E02B0511A/image-size/large?v=v2&px=999 "Screenshot 2024-08-14 210128.png")

Let me know if you get it working!

- Tessa


author: Maruthi Veluru
body: If my understanding is right , once you have lookup objects, create variables to capture specific asset fields   

then you can use them for validations example I have used peak start and end dates coming from assets object  

![IMG_6829.png](https://community.atlassian.com/t5/image/serverpage/image-id/341832i22C4DB28C4E683B8/image-size/large?v=v2&px=999 "IMG_6829.png")

then you can smart values condition

<br />

![IMG_7051.png](https://community.atlassian.com/t5/image/serverpage/image-id/341834iD131DB10D9C5F53A/image-size/large?v=v2&px=999 "IMG_7051.png")  


Tags: assets

cloud

cloud-automation

jira-service-management

jira-service-management-cloud