- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-25-2023 11:57 PM
Hi,
I want to write filter condition to display the change request only whose planned end date was exact 5 days ago. It should not show the change request who planned end date is more that 5 days ago.
How can I achieve this one.
Any help would be appreciated. Thanks in Advance.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2023 12:57 AM - edited 05-26-2023 01:07 AM
Hi @Anamika Thakur ,
You can use below code to get the change request whose planned end date was exact 5 days ago
var chgGr = new GlideRecord("change_request");
chgGr.addEncodedQuery('end_dateRELATIVEGT@dayofweek@ago@5^end_dateRELATIVELT@dayofweek@ago@4');
chgGr.query();
while (chgGr.next()) {
gs.print(chgGr.number);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2023 12:05 AM
Hi @Anamika Thakur ,
Please refer the below link.
If my answer resolves your issue then don't forget to mark it as correct/helpful.
Regards,
Devender
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2023 12:57 AM - edited 05-26-2023 01:07 AM
Hi @Anamika Thakur ,
You can use below code to get the change request whose planned end date was exact 5 days ago
var chgGr = new GlideRecord("change_request");
chgGr.addEncodedQuery('end_dateRELATIVEGT@dayofweek@ago@5^end_dateRELATIVELT@dayofweek@ago@4');
chgGr.query();
while (chgGr.next()) {
gs.print(chgGr.number);
}