
- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on 09-16-2022 04:30 AM
There are different HR task types that can be assigned to different personas using ServiceNow. From “Mark as complete” to HR service submission.
HR agents working on the Agent Workspace can easily complete simple tasks that does not require to interact with HR services.
If HR agents need to complete a task that requires to fill a HR service form, they will need to go to the portal to get the Record Producer variables displayed. For this purpose, ServiceNow displays a message that informs HR agents they must go to the portal to complete these types of tasks.
This message appears out of the box in the back end when the HR task type is HR service and the task is assigned to the user viewing the task. However, there is no message available in Agent Workspace.
To make the message compatible with Agent Workspace follow these steps:
1. Go to business rules.
2. Find the Info message for ack type Business rule for the HR Task table.
3. Go to the Advanced tab.
4. Update the condition to: new sn_hr_core.hr_Utils().userHasSPClientRole()
The default Business Rule script is generating a link that points to the HRM ticket page for HR services, Catalog Items & Order guides. HRM ticket page requires a record in the ticket configuration table. For this reason, we will propose a simpler alternative that works with all type of Task types keeping the default standard ticket configuration as is.
5. Update the Business rule script to:
(function executeRule(current, previous /*null when async*/ ) {
var todoConfig = new GlideRecord('sn_hr_sp_todos_config');
todoConfig.get('name', 'HR Tasks');
todoConfig.getUniqueValue();
var todoID = todoConfig.getUniqueValue();
var portalSuffix = new sn_hr_sp.hr_TicketPageConfigUtil().getActivePortalURLSuffix();
var ticketPageUrl = "/" + portalSuffix + "?id=hrm_todo&view=sp&sysparm_tableName=sn_hr_core_task&sys_id=" + current.getUniqueValue();
var infoMsgWithURL = "Go to <a title=\"Service Portal\" target=\"blank\" rel=\"nofollow\" href=" + ticketPageUrl + "&todo_sys_id=" + todoID + ">Service Portal</a> to continue to work on this task";
gs.addInfoMessage(infoMsgWithURL);
})(current, previous);
6. Update the record, it should look like this:
With the updated script we will point Agents to the portal record when HR task type is HR Service, Submit Catalog Item or Submit Order Guide (as per the BR conditions). Once the HR agent assigns the task to him/herself the message will be displayed containing the link to the appropriate to-do in the portal.
The result is the following:
- 1,251 Views