- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-07-2017 04:36 AM
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.
Solved! Go to Solution.
- Labels:
-
HR Service Delivery

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-08-2017 05:49 AM
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();
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-07-2017 05:51 AM
Hi Michael,
By default, other scopes can create records in the incident table. What you need is a UI action that the HR worker can click (there may be one already - check.) The UI action would then create the new incident record and copy over the fields you intend.
http://wiki.servicenow.com/index.php?title=UI_Actions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-07-2017 11:42 PM
Thank you for the tip with the UI action this helped me a lot.
Sadly there is no predefined action that can be directly integrated.
As I'm not really familiar with the programming style of ServiceNow I tried to search for related problems and came up with the following script
function createIncident() {
confirm("Do you want to create an incident");
// to make sure my script is executing
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();
}
I do get the confirmation window but when searching for the newly created Incident in the Incidents table, I can't seem to find it.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-08-2017 05:49 AM
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();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-30-2017 10:46 AM
Hi Chuck,
When creating the Incident from the HRC, does the INC automatically keep a reference to the HRC#? Does the process also auto-close the HRC?
Thank you,
Mary Brown
HRIS Project Coordinator
UW Health