UI Action
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-13-2024 05:25 PM
Hi all,
I am creating a new UI Action where there is a button in Incident table named 'Close Child Incident'. When in a parent incident I click that button it should close the child incident attached to it but it is not working.
Here is my script...
function demoClientScript() {
var answer = confirm("Are you sure you want to close the child incident?");
if(answer == true) {
gsftSubmit(null, g_form.getFormElement(), 'sys_demoaction');
}
var gr = new GlideRecord('incident');
gr.addQuery('parent_incident', current.sys_id);
gr.query();
while (gr.next()) {
gr.state = '7';
gr.update();
}
action.setRedirectURL(current);
}
And this is my settings in UI Action table
It shows the button on the incident table but does not not close the child incident.
Please help.
1 REPLY 1
Community Alums
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-13-2024 09:01 PM
Hi @MohdF ,
Please refer to this thread: https://www.servicenow.com/community/itsm-forum/ui-action-script-to-close-child-incident/m-p/853463