How to redirect Link in prod ?

suresh40
Tera Contributor

Hi All,

In notification I had created link in that, I have give dev URL and migrate to prod . in production user click on the it redirecting to dev in ServiceNow. Every time I having chaining dev to prod in prod . There is any way while creating link in dev after migrating to prod Link should be redirect to prod .

 

Thanks ,

Suresh

3 REPLIES 3

Mark Roethof
Tera Patron
Tera Patron

Hi there,

Can you share what you've setup?

Without knowing what you've setup, perhaps you used a full URL? Like:
https://your-instance.service-now.com/incident_list.do?sysparm_query=&sysparm_view=

You could just leave the instance URL of. This would be enough:
/incident_list.do?sysparm_query=&sysparm_view=

Or perhaps you scripted the URL? You could make it dynamic using:

gs.info(gs.getProperty('glide.servlet.uri'));

If my answer helped you in any way, please then mark it as helpful.

Kind regards,
Mark
2020-2022 ServiceNow Community MVP
2020-2022 ServiceNow Developer MVP

---

LinkedIn
Community article, blog, video list

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

Hi Mark,

While user rising the ticket , after completion of the ticket user get the notification .In that notification I'm send survey form link . In that link I have given dev environment Link ,for dev environment its working . After migrating  dev to prod environment user clicking on that notification its redirecting  to dev environment.

Allen Andreas
Administrator
Administrator

Hi,

When building URLs that you want to use across multiple instances, it's best to follow guidance like in this URL: https://servicenowguru.com/scripting/business-rules-scripting/finding-instance-name-via-script/

For instance you can use:

var instanceURL = gs.getProperty('glide.servlet.uri');

and this would at least get the current instance name: https://instancename.servicenow.com -- and then you can build the rest of the URL from there.

Please mark reply as Helpful/Correct, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!