Get URL in Agent Workspace

Maddalena Mores
Kilo Expert

Hi, 
in Agent Workspace I created a Related List Action implemented as Server Script.

I wolud like to get the URL. I tried with gs.action.getGlideURI() and I recieved this string: api/now/v1/batch?api=api, but I need to recieve the URL string like this: /now/workspace/agent/record/rm_release/3b682b1bdbc2d850ceb3ef08489619aa.

 

How can I do that?

 

Thanks in advance
Maddalena

7 REPLIES 7

Kim Sullivan
Tera Guru

In your client script for the UI Action, you can use top.location.href to get the URL.

ayanc27
Kilo Expert

Hi,

top.location.href will only work for client script. Could anyone have idea what we can use in Server side code to get it?

 

thanks!

JagjeetSingh
Kilo Sage
Kilo Sage

Did you ever find an answer to this?

Jagjeet Singh
ServiceNow Community Rising Star 2022/2023

Hi Jagjeet,

 

 

did you find a way to get the agent workspace URL from server script ?

 

Thanks

Agathe