How to set RITM and Request to Closed incomplete when sc task is closed incomplete

Joshuu
Kilo Sage

Hello All,

I have a catalog item which is having 3 catalog tasks.

1) to A team

2) to B team

3) to C team

So If A team task is set to closed incomplete then B and C tasks should not get triggered and also RITM(state and Stage) and Request state should also set to closed incomplete.

Please assist.

 

Thank you,

Priya.

1 ACCEPTED SOLUTION

@priyarao 

your workflow is running on RITM so you cannot check State of RITM since you want to know state of Catalog Task

You need to check state of the catalog task for this RITM by using Script

answer = ifScript();

function ifScript(){

var task = new GlideRecord('sc_task');

if(task.get('request_item', current.sys_id)){

if(task.state == '3'){
return 'yes';
}
else{
return 'no';
}

}

}

Regards
Ankur

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

View solution in original post

10 REPLIES 10

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

how are the other tasks created?

If via workflow then you can use if activity to check the Catalog Task state of the closed task and accordingly create or ignore B and C Task

Regards
Ankur

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

Hello Ankur,

find_real_file.png

 

find_real_file.pngeven if the task is closed complete. still it is going to No and then marking as incomplete.

@priyarao 

your workflow is running on RITM so you cannot check State of RITM since you want to know state of Catalog Task

You need to check state of the catalog task for this RITM by using Script

answer = ifScript();

function ifScript(){

var task = new GlideRecord('sc_task');

if(task.get('request_item', current.sys_id)){

if(task.state == '3'){
return 'yes';
}
else{
return 'no';
}

}

}

Regards
Ankur

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

Hello Ankur,

Yes, it is working as expected now. But I have a doubt here.. Is there any impact for other tasks in other catalog items because of this if condition as we are gliding sc_task table here.

Or this is applicable only to this item?

 

Thank you,

Priya.