sc_task autocloser by flow designer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2022 03:32 AM
Hi,
I need to autoclose a catalog task after 5 days from the last update (sys_updated_on). Can we do it by Flow Designer?
More details:-
Lets say, the task is created on 31st Jan. Now if there is no update (sys_updated_on) in that task for continue 5 days, the task will be autoclose on 5th Feb. But if there is any update within 5 days, the timer will count again for 5 days from that particular update time.
The task should be autoclose after 5 days from the last update (sys_updated_on) time.
Please note I need to use Flow Designer and not Work Flow.
This is what I designed but no luck.
(Taken 1 min duration for testing)...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2022 04:39 AM
This is what I designed but no luck.
(Taken 1 min duration for testing)...

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2022 05:22 AM
Instead of this, create a schedule job that runs every hour and close all task that are open and not update for 5 days instead of using Flow. Refer the below script
var queryTime = new GlideDateTime();
queryTime.addDaysUTC(-5); // Update 5 with actual number of days
var gr = new GlideRecord('sc_task');
gr.addQuery('resolved_at', '<', queryTime);
gr.addQuery('state', '1'); // Adding condition to run only for Open task.
gr.query();
while(gr.next(){
gr.state = '3'; // Update the state to closed complete and update
gr.update();
}
Palani
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2022 08:55 PM
Hi palanikumar,
Thanks for your response.
Yes, currently the autocloser of the task achieved by creating schedule job.
But, as we have a proposal to check if we can achieve it by Flow Designer itself, I need suggestion on the same.
Again thanks a lot for sharing your idea.
Cheers...
Swagata

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2022 09:15 PM
HI Swagata,
Can you try this, I have made the flow to run every 1 hour. I think this is more efficient than making the flow to check for 5 non update days to close it.
Trigger - run every 1 hour
Action -
1. look up records which are updated before 120 hours
2. For all records from step 1
3. Update the state to closed complete or incomplete based on your logic.