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

Using Automation to populate an Assets field with values of attributes from another Assets fields

Andrew Januszak
Contributor
July 2, 2024

I have two object types in Assets:

  1. Software
  2. Location

Software has an attribute called Locations, which pulls from/refers to the objects in Location. 

I have two Assets custom fields:

  1. "Software title" - pulls from the Software object type
  2. "Software locations" - pulls from the Location object type 

Via Automations and ignoring triggers, when the "Software title" custom field is populated with an object, how can I take the value(s) from the Locations attribute of that object and copy them into the "Software locations" custom field?

2 answers

1 accepted

1 vote
Answer accepted
Andrew Januszak
Contributor
July 2, 2024

Figured it out; it was as simple as using the Edit issue action (setting the value for the Software locations field) and inserting an AQL query like so: 

objectType = Location AND object having inR(Key IN ({{issue.Software title}}))

 

0 votes
Cael Metcalfe
Contributor
July 2, 2024

You must have the actual Asset referenced in the Asset Custom Field for this to work.

If you do, then you can use smart values to access the Attributes of an Object stored in an Asset Custom Field on an issue.

Eg: {{issue.fields."Software title"."Some Attribute"}}

And if the Attribute on the Asset is an Object type, then you can dot reference its attributes too.

Eg: {{issue.fields."Software title"."Locations"."Attribute In Linked Location Object"}}

You can then use the "Edit issue" action to set the required Issue field with the value returned from the Asset, using this smart value.

If the field is not available from the drop down list on the Edit issue action, you may need to use the Advanced field editing options.

See here: [https://support.atlassian.com/cloud-automation/docs/jira-automation-actions/#Edit-issue]

Andrew Januszak
Contributor
July 2, 2024

Thanks Cael, 

I didn't realize you could chain like that. Unfortunately, this is the response I get in the Audit Log when I try that method: 

An error occurred while requesting remote information

Bad Request
No fields or field values to edit for issues (could be due to some field values not existing in a given project):

The "Software Locations" Assets custom field is available from the drop down list, is on the appropriate screens, and can be edited by the actor of the automation rule.

I logged the values that {{issue.fields."Software title"."Location"."Attribute In Linked Location Object"}} returns (which are correct), and this is how they're presented:

[location_a, location_b]
Like John Funk likes this

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