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

Automation to update multiple asset object fields based on single selection?

Mathieu October 26, 2023

Hello Community,

 

I'm trying to create an automation rule to update the Company, Department and Office asset object fields based on the value in my "All branches" assets objects type field.

I have mobile VIP tech support agents that we're trying to accommodate, and updating three fields is two too many...

 

I'd like to be able to have them only fill out the "All Branches" (customfield_10217) field and to scrape the rest of the required info from that field.

I'm running into issues crafting the proper series of {{lookupObjects}} and edit issues to get this accomplished.


Asset Schema

In Department I have a "Company Name" attribute, and in Office I have a "Department name" attribute. How it currently works is that the Department field will change what is populated based on the on the Company field selection, and the Office will depend on the Department field, based on Filter issue scope.

My "All Branches" field has the same Filter scope, but no Filter issue scope, as the Office asset field.

 

Custom Fields

My Company Field - customfield_10112Company Asset Field.png

Department Field - customfield_10113Department Asset Field.png

Office Field - customfield_10114

Office Asset Field.png

Automation rule errors

My automation rule can currently update the Office Asset Field with the All branches with no issue since they share a 1:1 link, and I can correctly query the lookup object and add it to the audit log, but when I try to edit the issue I encounter

"An error occurred while requesting remote information

Bad Request"
Audit Log.png

 

I've snipped my current automation rule, but I can't get it to populate Department yet, haven't even tried Company.


Update from all branches automation 1.png
Update from all branches automation 2.pngUpdate from all branches automation 3.png
Hoping someone can steer me in the right direction for this.
Thank you

1 answer

1 accepted

3 votes
Answer accepted
Mathieu October 27, 2023

I ended up resolving this by using Jira smart values - Assets | Cloud automation Cloud | Atlassian Support

and using the object reference section

{{object.(reference name).(attribute name)}}

I used edit issue to copy Office Asset Field from the value in All branches since they are the same data.

re-fetched issue data

then I used Edit Issue on the Department Asset Field with:

Name Like "{{issue.customfield_10114.Department Name.name}}

re-fetched issue data

and the Edit Issue on the Company Asset Field with:

Name Like "{{issue.customfield_10113.Company Name.name}}"

 

Using the {{object.(reference name).(attribute name)}} way to reference things

customfield_10113 is the object.

Company name is the Reference name

Name is the Attribute name

This fills the three fields I needed (Company, Department and Office) from the All Branches  (=Office)

 

Resolved Automation 1.pngResolved Automation 2.png

Suggest an answer

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

Atlassian Community Events