- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2022 06:43 AM
When I click on "Take me to the Case" it takes me to the ITIL view of the case and not the "HR Agent Workspace" view.
How can I update the notification email script to take me to the "HR Agent Workspace" view?
Solved! Go to Solution.
- Labels:
-
HR Service Delivery

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2022 06:52 AM
Hi,
If you look closely, you are getting the link from a script include, which is line 2.
I would suggest look into it to better understand how these works OOB
Script include: sn_hr_sp.emailUtil and getLink() and _shouldGoToServicePortal() functions.
Right now, there are certain conditions that it is checking to open the record.
I think it will be better to stick to OOB, else you can by default create a link of yourself and add using a new email template.(refer to _getPortalLink() within the same script include)
Aman Kumar

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2022 09:30 AM
Try :
link = link + '&sysparm_view=agent_workspace&sysparm_view_forced=true';
Aman Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2022 09:44 AM
Thnaks! But, It didn't work.
It took me here (ITIL View)
https://MyCompanydev.service-now.com/nav_to.do?uri=%2Fsn_hr_core_case.do%3Fsys_id%3D2596f66edb8191140ae1a9f705961991
It needs to take me here (HR Workspace View):
https://MyCompanydev.service-now.com/now/workspace/hr/record/sn_hr_core_case/2596f66edb8191140ae1a9f705961991

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2022 11:07 AM
I am not sure, if you saw my response below, in which I have explicitly mentioned, that the script include will not work for workspace view, the URL is built differently for it.
So you will have to create a different email script for this:
Check below response by Anil Lande:
Email Script: Navigate Link on email to HR agent workspace instead of Servicenow Portal
Aman Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2022 01:23 PM
Thank you!
I added this to the Email script and it worked.
var recordClass = current.sys_class_name
var sysID = current.sys_id;
var instanceName = gs.getProperty("instance_name"); //Pulls Current System
var link = "https://" + instanceName + ".service-now.com" + "/now/workspace/hr/record/" + recordClass + "/" + sysID; //+ "/" + current.getValue("number");

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2022 07:34 PM
Hi
Is your issue resolved?
If yes, Feel free to mark correct, if your issue has been resolved, so it ends up in solved queue.
Will be helpful for others looking for the similar query.
Aman Kumar