Need a filter to get all the incidents where resolved after 2,4,7 days

Sam ServiceNow
Tera Contributor

Hi Experts,

 

I want to use "Lookup records" Action in Flow Designer to get all the records of Incident which are in resolved state for 2 days (using resolved date and time field), so that I can send reminder and similarly reminder for 4 days.

Can someone please help in providing the filter screenshot in incident list.

 

Thanks in advance.

 

2 REPLIES 2

sourav1999
Mega Guru

- Create a filter to get all the incidents resolved after 2,4,7 days in ServiceNow
- Use the 'Resolved' field in the 'sys_updated_on' condition
- Select the 'greater than' operator and enter the required days
- Save the filter and run it to get the desired results

 

For asking ServiceNow-related questions try this :

For a better and more optimistic result, please visit this website. It uses a Chat Generative Pre-Trained Transformer ( GPT ) technology for solving ServiceNow-related issues.

Link - https://nowgpt.ai/

 

For the ServiceNow Certified System Administrator exams try this :

https://www.udemy.com/course/servicenow-csa-admin-certification-exam-2023/?couponCode=NOW-DEVELOPER

Manmohan K
Tera Sage

Hi @Sam ServiceNow ,

 

You can use below code to get incidents which have been resolved for 2 days

 

 

var incGr = new GlideRecord("incident");
incGr.addEncodedQuery('resolved_atRELATIVEGT@dayofweek@ago@2^resolved_atRELATIVELT@dayofweek@ago@1'); 
incGr.query();
while (incGr.next()) {
    gs.print(incGr.number);
}

 

 

 

Similarly just modify filter in line 2 to get incidents which have been resolved for 4 days

 

 

 

incGr.addEncodedQuery('resolved_atRELATIVEGT@dayofweek@ago@4^resolved_atRELATIVELT@dayofweek@ago@3');