Compare "Last Scanned" and "Install Date" on cmdb_sam_sw_install table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2019 06:06 AM
Hello everyone!
I am trying to create a business rule that compares the "last scanned" and "install date" fields, whatever records that are found to be 90 days older than the newest date in the install column, those should be deleted.
Script that i started:
var gr = new GlideRecord('cmdb_sam_sw_install');
gr.query();
while(gr.next()) {
var gdt1 = new GlideDateTime("last_scanned");
var gdt2 = new GlideDateTime("install_date");
var dur = new GlideDuration();
var dur = GlideDateTime.subtract(gdt1, gdt2); //the difference between gdt1 and gdt2
gs.print(dur.getDisplayValue());
}
Is it possible to compare a date field with a date/time field? If so, is there another thread in the community i can reference?
Any information is appreciated!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2019 07:44 AM
Hello Othomas,
Any update on it?
If I have answered your question, please mark my response as correct so that others with the same question in the future can find it quickly and that it gets removed from the Unanswered list.
Thank you, Abhishek
Abhishek Gardade
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2019 06:27 AM
Hello Thomas,
Is your issue resolved?
Thanks,
Abhishek
Abhishek Gardade