The CreatorCon Call for Content is officially open! Get started here.

UI Action

MohdF
Tera Contributor

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

Screenshot 2024-08-14 at 5.52.01 AM.png

 

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