Insight import: How do I update an object only if a date attribute is newer

Johannes Buverud
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 6, 2018

We have computers in two different domains, called D1 and D2.

Sometimes some of the computers are moved from one domain to the other.

The computers have an agent checking in to a management tool in each of the domains.

I have two database import jobs runing after each other, one for D1 and one for D2.

Among others, the import job sets an date attributes called "Last check in date".

(This date tells us when the computer was last used.)

Problem: A computer first was in D2, and then was moved to D1. The first import job (D1) sets the correct "Last check in date", but this is then overwritten by the second import job (D2) which sets "Last check in date" to the last time the computer was in that domain.

Is there a way to solve this?

1 answer

1 accepted

1 vote
Answer accepted
Alexander Sundström
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 7, 2018

Hi Johannes,

I see the problem, but there is currently no functionality in the import to stop an attribute from being imported based on some logic, like if the date imported is earlier than another. If an attribute has changed, that value is simply imported, and the Insight object is updated.

Feel free to create an feature request for this at jira.riada.se

If you feel like this answered your question, please mark it as accepted :)

Best Regards
Alexander

Johannes Buverud
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 7, 2018

Thanks, Alexander.

I guess I may solve this by storing the imported date in a "temporary date" attribute, and then use a post function script to copy the date to the "Last check in date" only if it is newer.

But a pre check functionallity would be great, here is the feature request:

https://jira.riada.se/browse/ICS-703

Alexander Sundström
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 8, 2018

Thanks for creating the request.

Yes, in that case you could use an automation rule, to check using groovy script if the date set is newer or not, and based on that logic copy the value and set it to the field.

We have an example on how to update an attribute value from an object at 

For more information about automation, take a look at 

Cheers!
Alexander

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events