How can I update the notification email script to take me to the "HR Agent Workspace" view?

Shy
Tera Contributor

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?

find_real_file.png

 

find_real_file.png

1 ACCEPTED SOLUTION

Aman Kumar S
Kilo Patron

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)

Best Regards
Aman Kumar

View solution in original post

10 REPLIES 10

@Shy 

Try :

 link = link + '&sysparm_view=agent_workspace&sysparm_view_forced=true';

Best Regards
Aman Kumar

Shy
Tera Contributor

@Aman Kumar 

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

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

Best Regards
Aman Kumar

Shy
Tera Contributor

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");   

Hi @Shy 

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.

Best Regards
Aman Kumar