How to set values of RITM State value based on Catalog task state value in a workflow

Ansuha Chipuri
Kilo Guru

Hi

My Workflow just creates as catalog task whenever a RITM is created. Now

How to set values of RITM State value based on Catalog task state value in a workflow

Like if  Catalog task state is Closed Complete, RITM state  should be closed Complete

       if  Catalog task  state is Closed Incomplete, RITM state should be Closed Incomplete

With regards 

1 ACCEPTED SOLUTION

Prasant Kumar 1
Kilo Sage

Hi,

Please follow the below steps:-

Step 1:- In Work flow after catalog task activity insert an run script activity and Enter the following code below.

var catTask = new GlideRecord('sc_task');
catTask.get('request_item',current.sys_id);
if(catTask.state == 3){    //'3' for state closed complete in catalog task table(sc_task)
current.state = 3;            //'3' is ritm close complete state value.
current.update();
}

//Like wise you can generate other state value conditions....

 

If i was able to solve your query, please mark my answer correct and helpful.

Thanks & Regards

Prasant Kumar sahu

View solution in original post

5 REPLIES 5

Hi,

if you wish RITM state change on every TASK change then ensure BR runs always

If you wish RITM state to change on last task then in script check if this task is the last task which is getting closed and then update RITM

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader