Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

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

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

Vishwa Pandya19
Mega Sage

Hello,

 

Do you want to remove the value from the Special Instructions field for all Catalog Items or a certain catalog item?

only for one catalog item and i have to display value in special instructions in 2 nd and 3 rd sc task only