- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2022 04:25 AM
I want to create a UI action button to create a new child incident with the current incident as a parent.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2022 04:38 AM
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);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2022 04:46 AM
Hi
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