Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Insight automation troubleshoot - update object attribute when an inbound reference is added

Stella Marie Alice Bakhoff September 9, 2022

Hi community

Using Jira Data Center v8.20.10.

Goal:
To connect assets with persons and have up to date statuses (e.g not in use, in use) for assets.

Situation:
I have a one schema and two object types - "Person" and "Laptop".
"Person" object type (and respective objects) have an attribute called "Laptop" (attribute type "Object" -> "Laptop")

1. Object "Human" (in object type "Person") is updated with an attribute called "Laptop" -> new value is  "Computer".
2. Object "Computer" in object type "Laptop" has now 1 inbound reference -> object "Human".
3. Object "Computer" has an attribute (type Status) called "Laptop status" and current value is "Not is use"
4. Now that "Computer" got an inbound reference, the attribute "Laptop status" for object "Computer" should be automatically updated and given a new value "In use"


So I created an automation (screenshot), but it does not seem to work. What am I missing? Could it be that the trigger is wrong (e.g adding new inbound reference does not count as "Object updated"?) or can anyone recommend a better/other way to solve this? 
Insight automation.jpg
Thanks 
Alice

 

1 answer

1 accepted

0 votes
Answer accepted
PD Sheehan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 10, 2022

The issue with what you have is that the "Object Updated" event fires on the Human object. There is no visible change or event fired on the Computer object.

The "IF" block won't allow you to fetch another object. It's only meant as a filter for objects associated with the Trigger.

You have 2 options. 

1) Continue to use Object Updated trigger and write a groovy script to serve as the Action.

2) Use a Schedule Trigger with the following IQL:

objectType = Laptop and object having inR(objectType=Person) and "Laptop status" != "In use"

You can set your schedule fairly small (maybe 15 minutes). The vast majority of the time, the IQL will return zero results and no further actions will take place. When 1 or more Person has been updated in the last 15 minutes, then those will have their corresponding status updated.

In your Action block for the attribute value, just type "In use". No need for ${}.

You might also want a second automation to perform the reverse action

objectType = Laptop and object not having inR(objectType=Person) and "Laptop status" = "In use"

So that you can change the Laptop status from "In use" back to "Not in use"

Stella Marie Alice Bakhoff September 14, 2022

Thanks!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events