Scheduled job to close REQ,RITM,SCTASK

sanathk
Tera Expert

Hello community,

 

I have a requirement, I need to close to SCTASK'S which are not updated in past 120 days  along with associated Requests and RITM through Scheduled jobs

 

Here I have some scenarios to handle

Scenario 1: I need to close the SCTASK'S which are not updated in past 120 days and exclude the sctask configuration item starting with "abc" after closing the sctask,I need to close the RITM associated with the sctask and Request associated with the above RITM

Scenario 2: For example we have a RITM which has three SCTASK'S one is not updated in past 120 days and another 2 are updated recently so we need to close only the sctask not updated in past 120 days and in this scenario we should not close RITM and Request.( Here also we need to check the sctask and exclude the configuration item starting with "abc" sctask)

Scenario 3: For example we have a request that contains more than one RITM here also we should check if both RITM s  are closed we need to close request and if one RITM is closed and another is open it should not close the Request 

 

Thankyou 

Sanath K.

7 REPLIES 7

Gurpreet07
Mega Sage

Just check if task is not updated in 120 days , if not updated then close the task

create a separate BR if all the sctask under a RITM closed then close the RITM

create a separate BR if all RITM under a request are closed, close the request

Hi @Gurpreet07 , Thanks for your response, I need to have a schedule job

And Can you please help me with conditions and code in Br

Mark Roethof
Tera Patron
Tera Patron

Hi there,

 

You could easily go for a Scheduled Flow and zero scripting. Just have the Scheduled Flow running daily, query for Catalog Task records updated more than 120 days ago, update the state of the Catalog Task. Again: zero scripting, just clicking your logic together through the GUI.

 

If your Workflow / Flow attached to the Catalog Items are setup correct, than automatically the Requested Item should close when all approvals and catalog tasks have been handeld.

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

Hi @Mark Roethof , Thanks for your response, we can use flow but in flow we don't have filter to check starts with here I need to exclude configuration starts with Abc again I need to go with script . I