Content Item dynamic URL

Andre8
Giga Guru

Is there a way to make the url of a content item dynamic so that when it is pushed to higher environments, the url stays in the correct instance. I have added a url to a content item in the portal in the dev environment but when I push this to a higher environment, the url directs the user back to the lower environment

4 REPLIES 4

Maik Skoddow
Tera Patron
Tera Patron

Hi @Andre 

the following article describes different approaches for creating dynamic URLs: https://community.servicenow.com/community?id=community_Article&sys_id=760c9af2db163cd011762183ca961...

Kind regards
Maik

Community Alums
Not applicable

Hi Andre,

Here the point is, when you are moving your changes to higher Environment, if your url has lower env details, then it will definitely take you to lower env.

 

Mostly URLs are not dynamic , its static as you want to redirect the user to that particular url.

Hence, in your higher environment make sure you change/update the URL.

 

 

Mark my answer correct & Helpful, if Applicable.

Thanks,

Sandeep

shloke04
Kilo Patron

Hi @Andre 

When you are defining your URL just make sure the URL starts with "/" and append the remaining bits as you need.

Do not append any instance Name in the URL like for example https:instanceName.service-now.com

URL format should be like below:

/$pwd_change.do

This way you do not need to hard code any instance name nor have to worry about pushing this to Higher environments. When you push this it will automatically take up the respective instance URL and should work for you.

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

mahesh_vavilal1
Tera Contributor
  1. If the content item is an external site, I recommend you get their prod url. I don't see a reason or any benefit in adding external site's nonPROD URL.
  2. If the content item URL value is one of your ServiceNOW instance pages, then you can skip the base URL.

Example: Assume content item URL is

https://community.servicenow.com/community?id=community_question&sys_id=77891608db6d0110fd63250913961990

you can skip the base URL and just use

/community?id=community_question&sys_id=77891608db6d0110fd63250913961990