Hw to set an Incident as a Parent incident Using Script?

Varshini Vishpa
Kilo Contributor

I want to create a UI action button to create a new child incident with the current incident as a parent. 

1 ACCEPTED SOLUTION

Afrith Shariff
Tera Guru

Hi varshini,

 To make the current incident Parent incident firstly we create an incident form object. Initialize it and assign the sys_id to the current object. (make the UI action Server Side)

use insert() to insert it into the table or else you need to make some additional changes and click on submit button.

 

var gr = new glideForm('incident');
gr.initialize();
gr.parent_incident = current.sys_id;
// This will redirect to the child incident form
action.setRedirectURL(gr);

View solution in original post

5 REPLIES 5

SumanthDosapati
Mega Sage
Mega Sage

Hi @Varshini Vishpathas ,

You can try below script in UI action

var gr = new GlideRecord('incident');
gr.initialize();
gr.parent_incident = current.sys_id;
gr.short_description = current.short_description;
gr.insert();

 

Mark as correct and helpful if it solved your query.

Regards,
Sumanth