Reference to an attribute of another object (Jira Assets / Insight)

mb
Contributor
November 24, 2023

Hi,

I have two objects:

  1. "Device Models", with attributes like "manufacturer", "price", "article number", …
  2. "Phones" assets, with attributes like "owner", "model"…

Now, I would like to use a reference to an attribute of "Device Models" in order to display the price and article number of a "Phones" asset.

I know that in the attributes of "Phones" I can create an attribute of type object and reference to "Device Models", but how can I reference to the attribute "price" or "article number" in the foreign "Device Models" object?phonePrice.pngdevicemodelPrice.png

The goal is to e.g. show the price and article number of the specific "Phone" asset when viewing it.

Thank you for any suggestions and thoughts.

Best Regards,
mb

1 answer

1 accepted

0 votes
Answer accepted
MF
Contributor
November 24, 2023

I think its not direct possible...

We had a similar need and used a workaround:

On Create/Update of an Object we use an Automation to copy the Values. So the Attributes have to be doubled, which is not sooo nice, but we get an Object with all Details without manual interaction.

We have to keep in mind, that changes on "the price" dont reflect directly in the "Phones". If needed, another Automation has to be implemented (maybe a nightly run over all objects)

mb
Contributor
November 27, 2023

Hello MF and thank you for your input,

Using an automation on object updated makes sense, but I cannot seem to get it to work:

  • Trigger
    When Object is updated
  • FOR AQL
    Object Type = "Device Models"
    • Then: Lookup objects
      ObjectType = "Device Models"
    • And: Create variable
      modelName = {{lookupObjects.Name}}
    • And: Add value to the audit log
      Device Model is {{modelName}}
    • And: Lookup objects (this does not work)
      category = object.Name / category = $.Name / category. = ${Device Models.Name} / category. = ${"Device Models".Name}
    • And: Add value to the audit log
      category is {{lookupObjects.Name}}
    • And: Create variable
      modelPrice = {{object.price}}
    • And: Add value to the audit log
      modelPrice is {{modelPrice}}
    • And: Edit object attributes (this does not work)
      phonePrice = {{modelPrice}}

Could you please share your automation?

I am not sure why my second lookup doesn't work (I tried the different values one by one as written above). I am also not sure how I can edit the related object because I think my automation only looks at the objects that are of type "Device Models" due to the Branch FOR AQL.

Maybe For each would be better? (EDIT: For each did not work either, but I used MF's approach and it's working now)

Thanks and Best Regards,

mb

MF
Contributor
November 27, 2023

I think you can simplify (at least thats our approach)

Trigger -> When Object is created/updated

When -> ObjectType = "Phone"

Then -> Edit Objectattributes -> phonePrice -> {{object."Device Models".price}} (add more attributes)

Repeat with ELSE for other types.

You still need the "connected" Objects (here "Device Model") as referenced Attribute on the "Phone" Object.

//

If your intention was, to set all "Phones", when changing a "Device Model" I think it is easier to Query all Phones and set their "price" than the other way.

In your example the automation will be "expensive" as it will run on every Object Update, even, when its not necessary.

Like mb likes this
mb
Contributor
November 27, 2023

Thank you MF, this is very helpful and a good + slim workaround.

Manuel Probst
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 27, 2024

Thanks for your solution MF,

i am trying to rebuild this in here https://community.atlassian.com/t5/Jira-Service-Management/Jira-Asset-Append-Attributes-from-referenced-objects/qaq-p/2881324

but somehow it doesn't work...

can you assist ?

MF
Contributor
November 28, 2024

Hi @Manuel Probst ,

I think object.field.attribute is the correct way...in your example {{object.customer.Kürzel}} (don´t know if the Umlaut is correct handled).

(The above example seems to be misleading with the given naming)

For clarification, you can Debug/use protocol action to view the current {{object}} - this should lead you to the correct string.

Suggest an answer

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

Atlassian Community Events