Create an IT incident from the HR plugin

zwimi
Kilo Contributor

Hi all,

I have a problem with an HRC. In the following my example:

An employee creates a request and the responsible HR worker delegates it to IT department, because he can not resolve the issue.
The HR worker therefore wants to open a ticket at the IT servicedesk.

For clarification:
The HR instance and the IT instance should be strictly seperated.

Here are my Questions:

1. How can the HR worker pass the HRC to IT department ?(create an INC)

2. Can the newly created ticket be configured, so only information, which is not confidential, is visible?

Hopefully someone can Help.

1 ACCEPTED SOLUTION

It would look something more like this - ensure you have the Client checkbox checked and the onclick field says "runClientCode()" (without quotes)



//Client-side 'onclick' function


function runClientCode(){


    if(confirm(confirm("Do you want to create an incident") == false){


          return false;   //Abort submission


    }


    //Call the UI Action and skip the 'onclick' function


    gsftSubmit(null, g_form.getFormElement(), '<button_action_name>'); //MUST call the 'Action name' set in this UI Action


}



//Code that runs without 'onclick'


//Ensure call to server-side function with no browser errors


if(typeof window == 'undefined')


    runBusRuleCode();



//Server-side function


function runBusRuleCode(){


        var inc = new GlideRecord('incident');


          inc.initialize();


          inc.short_description = 'Test description';


          inc.caller_id.first_name = 'John';


          inc.caller_id.last_name = 'Smith';


          inc.insert();


}


View solution in original post

20 REPLIES 20

Were you able to find a solution? I experience the same behavior


I found the error in the following line:



gsftSubmit(null, g_form.getFormElement(), 'Transfer to IT'); //MUST call the Action name set in this UI Action



above must reference the Action name = transfer_to_it




Hey Niels,



So where exactly would the change need to take place within that line? Are you able to describe (show) this?



Thanks,


-Rob


should it be:


find_real_file.png



instead of 'Transfer to IT'     --- ?


Yes, that should work