I have a requirement to add one option called last 83 days in interactive filter under opened field.

SAI BHAGYALAKSH
Tera Contributor

Capture.PNG

Hi Guys,

 

I need to add one option called 83 days under date filter options.

Please help me with the solution.

 

Thank you.

8 REPLIES 8

SAI BHAGYALAKSH
Tera Contributor

Hi,

 

I need to send like follow-up notification on 83rd day and after 7 days from follow-up notification needs to resolved automatically.

Mark Manders
Mega Patron

I hope you will have some other validations than '83 days after creation' (what if it's still being worked on, or has updates pending/changes waiting/problems attached), but per your requirement, create a scheduled job that runs daily and checks on the 83 days after creating:

// Calculate the date 83 days ago
    var grDateTime = new GlideDateTime();
    grDateTime.addDaysUTC(-83);
    var date83DaysAgo = grDateTime.getDate();

    // Query for incidents created exactly 83 days ago
    var grIncident = new GlideRecord('incident');
    grIncident.addQuery('opened_at', date83DaysAgo);

    PLEASE add other conditions as well (like active is true, not updated on last x days, etc)

    grIncident.query();

    while (grIncident.next()) {
        // Perform your validation logic for each incident
        gs.info("Validating Incident: " + grIncident.number);

        create event to trigger notification

        }
    }

 


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @SAI BHAGYALAKSH 

 

You can use the flow designer as well for the same.

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Please tell me how we can give condition in flow, opened is 83 days ?