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.

UI actions Create child incident; Solved!

LaasyaV71587518
Tera Contributor

LaasyaV71587518_0-1763682171589.png

LaasyaV71587518_0-1763683984406.png

 

Hello! this code is not working with the options I have selected. I am trying to create a child incident button using UI actions. I am using Xanadu. The "Create Child Incident" button is not showing on the incident form. 
Any tips appreciated! 

 

 

Hi! This problem has been solved! I figured out that the missing parts of the code was 

var childID = cinc.insert();
 
so the entire code all  together would be
 
var cinc = new GlideRecord('incident');
cinc.initialize();

cinc.short_description = current.short_description;
cinc.category = current.category;
cinc.subcategory = current.subcategory;
cinc.priority = current.priority;

cinc.work_notes = 'new incident has been created from ' + current.number;

var childID = cinc.insert();

gs.addInfoMessage('Child Incident has been created ' + cinc.number);
action.setRedirectURL(cinc);
0 REPLIES 0