- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2024 10:51 PM
Hi Developers,
I have created a Catalog Item and workflow with a single catalog task. when the catalog task state is "Closed Incomplete" then the request item state is in "closed complete". but it should be "Closed incomplete".
and same for the request too, when requested item state is "closed complete", request state should be "Closed Complete" by default. But in my case it's showing "Approved".
Please help me solve this problem.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2024 11:47 PM
Hi @Deepak kathi ,
You would need to update your workflow as per sample version shown below:
1. Right after where you are generating your catalog task, add a Run Script activity block and use the script shared below to resolve this:
updateRITM();
function updateRITM() {
var gr = new GlideRecord('sc_task');
gr.addEncodedQuery('state=3^request_item=' + current.sys_id);
gr.query();
if (gr.next()) {
current.state =3 ;
current.update();
}else{
current.state =4 ;
current.update();
}
}
Regards,
Shloke
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2024 11:11 PM
Hi @Deepak kathi ,
This can be done in workflow... Did you start creating workflow or flow for this catalog ? IF yes were are your struck...
☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2024 11:47 PM
Hi @Deepak kathi ,
You would need to update your workflow as per sample version shown below:
1. Right after where you are generating your catalog task, add a Run Script activity block and use the script shared below to resolve this:
updateRITM();
function updateRITM() {
var gr = new GlideRecord('sc_task');
gr.addEncodedQuery('state=3^request_item=' + current.sys_id);
gr.query();
if (gr.next()) {
current.state =3 ;
current.update();
}else{
current.state =4 ;
current.update();
}
}
Regards,
Shloke