Insight Automation rule - Creating Issue on update of specific object attribute through history

Marcus Rose March 25, 2020

Hey there (newbie incomming :)),

I'm trying to setup an Insight automation rule (for testing purposes), which is supposed to run every time a specific attribute is updated by a specific user but I'm struggeling getting my head around the Insights Query Language especially using placeholders (even after reading through the docs).

I'm having an objecttype, which is called component, which contains a mac-address.

I also have a SCCM Integration which is supposed to overwrite the mac-addresses of every component overnight using a "System User" to update the mac-address components, which makes the change-performer visible in the history (/activity) of the object (This works works as espected). 

So now the idea is to run an automation, which gets triggered by an object-update and creates an issue IF the Objectype="component" AND (here my IQL capabilities come to an end) the changed attribute of the objecttype is called "mac-address" AND the user who submitted the change is called "System User".

--> following this idea, I should be able to filter the change, which happened on the component, out of the object history (/activity) events (pseudo-code):

IF:

component.activity.type = "changed value" AND component.activity.attribute = "mac-address" AND component.activity.performer="System User"

Do you have any ideas on how I can pull this information out of the database?

 

Thanks in advance

1 answer

1 accepted

0 votes
Answer accepted
Craig Haynal
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.
March 26, 2020

Unfortunately I don't believe there is a way to make IQL search the history.  The only way I can think of accomplishing what you want is to create an automation that triggers on object update when the objectType check for your object type matches then having an action of Groovy script.

The script would have to do the rest of the testing by retrieving and analyzing the ObjectHistoryBean objects associated with your object to see if the right value was changed by the right user per your example.  The Insight JavaDoc has the reference documentation for the Java APIs that Insight provides.  They have a number of Groovy examples in their documentation, though I haven't seen one that references the object history nor have I specifically written anything that uses the object history.

This one will likely take a fair bit of Insight scripting to pull off.

Marcus Rose March 27, 2020

Hi Craig,

thanks for the answer. I already expected something like this, since I've seen a feature request for another but similar topic, yesterday, about analysing the actions in the history.

Thanks anyway :)

Amit Girme October 3, 2020

Hello Marcus,

 

Were you able to write a script here? If yes, could you please share it? I am also looking for a trigger on particular attribute update. Or any specific example/thread which can be referenced

 

Thanks,

-Amit

Marcus Rose October 4, 2020

Hello Amit,

I'm sorry but no, because the whole thing of using JSD and Insight as a CMDB host was just a experiment, I didn't put any more efforts into it.

 

-Marcus

Amit Girme October 5, 2020

It's ok. Thanks for your reply Marcus.
If I am able to solve I will post to community :-)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events