Built something you're proud of? Tell the story. A quick G2 review of App Engine or Build Agent helps other developers see what's possible on ServiceNow. Share your experience.

when problem is created change related incident state to onhold and onhold reason is awaiting caller

PSaiSowjanya
Kilo Contributor

when a problem is created change related incident state to onhold and onhold reason is awaiting caller.
Table:Problem
when to run: After Insert

Script:

var gr = new GlideRecord('incident');
gr.addQuery('problem_id', current.sys_id);
gr.query();
if (gr.next()) {
current.state = 3;
current.hold_reason = 1;
}

I have tried this code,But It is not executing as expected,After creating problem  record on related incident form it is showing state as onhold and on hold reason is awaiting problem.
 
0 REPLIES 0