how to remove special instructions data in the sc task after state is getting completed in sc task

raj765_32
Tera Contributor

hi can anyone help me with scenario for 

when i submit a catalog item there are three sc tasks in where i have written a code in 2 and 3 rd sc task to display some value in special instructions field.

 

What happening is that after i close complete 1 st sc task, the data/value written in  2 and 3 sc task is getting displayed when 1 st sc task is closed complete. 
please help me how to fix this and where to fix this in which sc task.

below is the code :

var gr = new GlideRecord('sc_request');
gr.addQuery('sys_id', current.request);
gr.query();
 
if(gr.next())
{
gr.special_instructions = "1. Complete template to request EP End User Access form Blue Yonder. \n\n2. Submit request (Medium priority) via Blue Yonder portal. 
gr.update();
}

my requirment is that it should not display in 1 st sc task when the task is completed or what ever state it should display in 2 and 3 sc task only
2 REPLIES 2

Community Alums
Not applicable

@raj765_32 ,

you need to add more queries in this code.

Is this BR? when it will run ?

i have wriite this code in workflow in 2 nd and 3 rd sc task but it is showing in first sc task after 1st sc task gets completed only, can you help me with the code?

thanks