Create HR Case UI Action from Interaction
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2023 01:08 PM
Hi,
We transitioned to the Configurable Agent Workspace recently. After the transition, any hr cases created from an interaction, is not default the contact_type. Would the UI Action on Create HR Case need to be updated?
Any help is appreciated.
Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2023 03:03 PM
Hi Giuliana,
If your HR cases are not defaulting the contact type when created from an interaction in the Configurable Agent Workspace, then it's possible that the UI Action on the "Create HR Case" button needs to be updated to set the contact type value.
To check and update the UI Action, follow these steps:
Find "Catalog UI Policies" module in Service Catalogs
Search for the HR case catalog item that is used to create HR cases from interactions.
Click on the "Related Link" icon and select "UI Actions".
Find the "Create HR Case" UI Action and click on it.
In the UI Action form, scroll down to the "Script" field and check if the contact type value is set. If it is not set, you can update the script to set the value.
Here is an example script that sets the contact type value to "Employee" when creating an HR case:
var hrCaseGr = new GlideRecord('sn_hr_core_case');
hrCaseGr.initialize();
hrCaseGr.setValue('short_description', current.short_description);
hrCaseGr.setValue('description', current.description);
hrCaseGr.setValue('contact_type', 'Employee'); // Set the contact type to "Employee"
hrCaseGr.insert();
Make sure to replace 'sn_hr_core_case' with the actual name of your HR case table. Also, update the code as per your specific requirements.
Once you have updated the UI Action, try creating an HR case from an interaction and check if the contact type value is set correctly.
Please mark my answer as solution/helpful in case it adds value and moves you a step closer to your desired ServiceNow solution goal.
Thanks,
Punit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2023 06:14 AM
Hi Punit,
The above did not work. Can something similar be done with a business rule?