RITM and Request must be same as Catalog Task state, When state changes

abdul rajak
Kilo Contributor

Hi All,

I want to keep RITM and Request states same as Catalog Task(SC TASK) state for particular catalog task's when state changes.

ex: If Catalog Task state changes to 'working in progress' then RITM and Request state also should be same in 'Working in progess'.

Please help me.

13 REPLIES 13

Try this:

var ritmGR = new GlideRecord('sc_req_item');
if(ritmGR.get(current.getValue("request_item")){
    ritmGR.setValue("state",current.getValue("state"));
    ritmGR.update();
}

var requestGR = new GlideRecord('sc_request');
if(requestGR.get(current.request_item.request)){
requestGR.setValue("state",current.getValue("state");
requestGR.update();
}
Best Regards
Aman Kumar

Hi Aman,

 

Yes, it is working as expected but when ever I changes state in SC TASK, it is reflecting in RITM, but not reflecting same in REQ(request).

 

RITM ScreenShot:

 

find_real_file.png

 

 

REQ ScreenShot:

find_real_file.png

 

 

Hey,

In request form, what you are looking at is Request state, you need to do Configure form layout on request table and bring "State" field on the form

Best Regards
Aman Kumar

Hi Aman,

Thank you so much.

 

I added state field on the request form, in the state fields whenever I changes state in sc task state, state values are reflecting on request but not in the Request state field. I want same state values in Request state like SC TASK and RITM. Can we do that??

 

find_real_file.png

OOB there does not exists any Work in Progress, Open, etc. state values for REQ table. All it has is as below.

find_real_file.png

So, you will need to create state values in accordance with sc_task table state values on REQ table as choices & then set values accordingly.

Can you confirm on why there is a need of such a use case which demands creation of additional state values.