How to get the Url of the current record in business rule

Akash Kajro
Tera Contributor

Hi 

 

how to get the  URL of the current record in business rule which i will be passing in the Rest message

5 REPLIES 5

Mohith Devatte
Tera Sage
Tera Sage

Hello @Akash Kajro ,

Can you try this in your BR 

gs.getProperty("glide.servlet.uri") + gs.action.getGlideURI();

Hope this helps 

Mark the answer correct if this helps you

Thanks

Voona Rohila
Kilo Patron
Kilo Patron

Hi @Akash Kajro 

You can try this to build the URL of the record

var url= 'https://'+gs.getProperty('instance_name')+'.service-now.com/incident.do?sys_id='+current.sys_id;

replace incident with the table name.


Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP

Hi Voona,

Where you have 'instance name', what happens when I move the BR to Test then to Prod as the instance will redirect to dev? Is this correct?

 

Thanks

Hello @Gugu M ,

Instance name will be automatically picked by system property.

This system property contains different value for each instance.

Hope it helps.

Regards,

Shubham