Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to fill a text customfield with an Asset object attribut

Mario GELES December 5, 2023

Hi community, 

I would have the city of the reporter in my Jira issues. 

The City is an attribute of Object in the ObjectType Users in Asset

To achieve this goal I have created a text customfiled called Site_Test and I have made an automation. Automation that doesn't work. 

My Automation : When a ticket is created if Site_Test is empty then lookupObjects with this query ObjectType = Users AND Name = "${reporter.label}" and then edit field Site_Test with :

{
"fields": {
"Site_Test": ["{{lookupObjects.City}}"]
}
}

Automation_Asset_Attribute_1.png

Automation_Asset_Attribute_2.png

I have set a log action before the edit field action. Log action : Site_Test : {{lookupObjects.City}} . The log indicates that Object is not found. When I change my query for ObjectType = Users AND Name = "Mario GELES"  the result is BORDEAUX but the customfield is still empty

Automation_Asset_Attribute_3.png

So I have two problems.

The first is that this part of my query Name = "${reporter.label}"  don't work. When I use this exact same query in an asset customfield it work so I don't understand why not in an automation. 

The second problem is that even if the query works the text customfield is still empty. 

Could someone help me with this ? 

2 answers

2 accepted

0 votes
Answer accepted
Mario GELES December 5, 2023

Well I found the solution to my first problem too.

It was not a big deal but I hope it could help someone someday. 
The solution is to keep it simple, just using the smartvalue : 

Automation_Asset_Attribute_5.png

0 votes
Answer accepted
Mario GELES December 5, 2023

I found the solution of the second problem. 
I used the simple way (not the Additional fields option) to set the field value with just the smartvalue {{lookupObjects.City}}. It worked

 

Automation_Asset_Attribute_4.png

Now, I just have to figure how to inject the name of the reporter in the AQL query

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events