What is the best method to configure transferring an HR Case to an Incident
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
I have a requirement to create a method to transfer an HR Case to an Incident. Is the best method to use a UI Policy from the HR Case Form?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @EarlH
To convert a ServiceNow HR Case to an Incident , create a server-side UI Action on the HR Case table that initializes a new GlideRecord incident, maps relevant fields (like caller and description), inserts the record, and redirects the user.
Note: You must handle cross-scope privileges, as HR is a scoped application and Incident is in the Global scope.
Sample code (Not tested)
- Name: Create Incident
- Table: HR Case
- Client: Unchecked (Server-side)
- Form Button: Checked
createIncident(); function createIncident() { var inc = new GlideRecord('incident'); inc.initialize(); // Map fields from HR Case to Incident as per your requirement inc.caller_id = current.subject_person; inc.short_description = current.short_description; inc.description = current.description; inc.contact_type = 'employee_service_center'; // Or appropriate type var newInc = inc.insert(); current.work_notes = "Incident " + inc.number + " created from this case."; current.update(); gs.addInfoMessage("Incident " + inc.number + " created."); action.setRedirectURL(inc); }
Refer:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @EarlH,
No, using a UI Policy is not the best method.
Instead, use a UI Action that triggers server-side logic (Script Include or Flow Designer) to transfer a HR Case to an Incident.
Try with UI Action and Script Include, post here if you have any other questions related to this scenario.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hello @EarlH ,
Refer this little different but similar can be made for HR case as well :
https://www.servicenow.com/community/csm-forum/how-to-convert-case-to-incident/m-p/408014/page/2
If my response helped mark as helpful and accept the solution.