How to fetch records which are having scheduled retirement date in next 3 months from now?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-28-2018 11:39 PM
Hi Team,
I have a requirement to fetch the records from cmdb_ci_computer table which is having asset.retirement date within 3 months from now.
Initially we were asked to fetch the records having retirement date on next week so I queried form the filter directly.
Here is the script
var gr = new GlideRecord('cmdb_ci_computer');
gr.addEncodedQuery('asset.install_statusNOT IN7,8^asset.retirement_dateBETWEENjavascript:gs.beginningOfToday()@javascript:gs.endOfNextWeek()');
gr.query();
while (gr.next()) {
gs.eventQueue("assignto_asset_refresh_event", gr);
}
But I have no idea how can I fetch the records having retirement date 3 months from now.
Any help would be highly appreciated. Thanks in advance.
Regards,
Sreeja
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-29-2018 12:16 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-29-2018 01:01 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-29-2018 01:14 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-30-2018 01:33 AM
Hello,
Has this worked for you?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-29-2018 01:36 AM
Hi,
paas this query "asset.retiredONThis quarter@javascript:gs.beginningOfThisQuarter()@javascript:gs.endOfThisQuarter()"