Update RITM State when Catalog Task is Updated

Marques2
Tera Expert

Hello All!

I have a requirement that has to be met where a RITM state has to be updated once ONE of the catalog task states moves from Open to Work in Progress. How can this be accomplished? Currently, when I put one of the Catalog Tasks in a Work in Progress state, the RITM state remains in a Pending state. However, for the initial Go-Live release, RITMs will not have group ownership- Each team will solely be responsible for their Task that's tied to that RITM.

Again, how can the RITM state move from Pending to Work in Progress once a Catalog Task moves from Open to Work in Progress?

Similar to how Catalog Tasks move to Closed Complete and the RITM and REQ are updated

Please reach out with any questions that you have!

Thank you all!

-Marques

12 REPLIES 12

Chuck Tomasi
Tera Patron

Hi Marques,



This would be done with an after business rule on the sc_task table. When you update an sc_task record, it checks all the "sibling" task records (records with the same request_item value) to see if any are Work in Progress. If so, check the request_item to see if it is currently in Pending. If so, move it to Work in Progress.



Pretty standard GlideRecord script in a business rule once you know the fields and values involved.



Reference:


Business Rules - ServiceNow Wiki


Business Rules Best Practices - ServiceNow Wiki  


http://wiki.servicenow.com/?title=GlideRecord


Can we do this in flow designer itself?

Abhinay Erra
Giga Sage

Write an After business rule on sc_task table


When: after insert and update


Conditions: State changes to Work in Progress


Script:


var gr= new GlideRecord('sc_req_item');


gr.get(current.getValue('request_item'));


gr.state='your choice value goes here';


gr.update();


Hey Abhi,



You'll need to do a little checking on the parent request to ensure that it hasn't already been set to some other state. Any task related to the parent RITM in this case will send it to Work in Progress (even if it advanced to a later state.)



Change (value of pending) to the numeric state of your pending state. I also double check if the gr.get() works and don't run any other statements (save a debug/error) if it does not.



Something like:



Write an After business rule on sc_task table


When: after insert and update


Conditions: State changes to Work in Progress


Script:


var gr= new GlideRecord('sc_req_item');


if (gr.get(current.getValue('request_item'))) {


        if (gr.state == (value of pending)) {


                  gr.state='your choice value goes here';


                  gr.update();


        }


}