Built something you're proud of? Tell the story. A quick G2 review of App Engine or Build Agent helps other developers see what's possible on ServiceNow. Share your experience.

UI Action to assign Incidents to Problem

Tom Lapkowicz
Tera Expert

I would like to create a list choice UI Action on the Incidents table where a user can select multiple Incidents, then select "Assign to Problem" from the Actions on Selected Rows drop-down and then a List Choice box of all Problems will appear for the user to select a Problem and then the Incident.Problem value is updated with the Problem selected.  Is this do-able?

 

See attached screen shot for more details (I created a UI Action called Assign to Problem but there's no code in it currently)

 

Thank you.

6 REPLIES 6

Hi @Tom Lapkowicz ,

 

UI page client script seems do not have full code.

function invokePromptCallBack(type) {

    var gdw = GlideDialogWindow.get();
    if (type == 'Save') {

        var selectedIds = gdw.getPreference('selectedIds');
        var problemId = document.getElementById('problem_id').value;
        alert(selectedIds + problemId);

        if (!problemId) {
            alert("Please enter a valid Problem.");
            return;
        }

        var ga = new GlideAjax('AssignIncidentsToProblem');
        ga.addParam('sysparm_name', 'processInc');
        ga.addParam('sysparam_sys_id', problemId);
        ga.addParam('sysparam_inc_ids', selectedIds);
        ga.getXML(serverResponse);



    }


    gdw.destroy();
    return false;
}

function serverResponse(response) {
    var answer = response.responseXML.documentElement.getAttribute('answer');
alert(answer);
	location.reload();
  
}

Use above code. If still didnt work share me code.

 

-------------------------------------------------------------------------

If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.


Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay

-------------------------------------------------------------------------

 

Hi @Runjay Patel  - I did have the full code for the UI page client script (sorry, it got cut off in the screen shot).