UI Action Redirect question

keshav77
Tera Contributor

Hi All,

i have case where Problem has been created through incident and I want create button on problem which will redirect it to the incident through which that problem get created.

how I can get this case

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@keshav77 

you can have server side UI action with this script

openIncident();
function openIncident() {
    var gr = new GlideRecord("incident");
    gr.addQuery("problem_id", current.sys_id);
    gr.query();
    if (gr.next()) {
        action.setRedirectURL(gr);
    }
}

AnkurBawiskar_0-1738078235677.png

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

View solution in original post

2 REPLIES 2

Sandeep Rajput
Tera Patron
Tera Patron

@keshav77 You can use 

    action.setRedirectURL('/incident.do?sys_id=' + current.sys_id);

to redirect user back to the incident in the UI Action script. 

Ankur Bawiskar
Tera Patron
Tera Patron

@keshav77 

you can have server side UI action with this script

openIncident();
function openIncident() {
    var gr = new GlideRecord("incident");
    gr.addQuery("problem_id", current.sys_id);
    gr.query();
    if (gr.next()) {
        action.setRedirectURL(gr);
    }
}

AnkurBawiskar_0-1738078235677.png

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader