diff --git a/Specialized Areas/Browser Bookmarklets/Open record in another instance/Open record in another instance.js b/Specialized Areas/Browser Bookmarklets/Open record in another instance/Open record in another instance.js new file mode 100644 index 0000000000..0408038644 --- /dev/null +++ b/Specialized Areas/Browser Bookmarklets/Open record in another instance/Open record in another instance.js @@ -0,0 +1 @@ +javascript:(function(){try{const u=location.href,m=u.match(/https:\/\/([a-zA-Z0-9-]+)\.service-now\.com/);if(!m){alert("Not a valid ServiceNow URL.");return;}const c=m[1],i=["dev12345","test12345","uat12345","prod12345"];const d=document.createElement("div");Object.assign(d.style,{position:"fixed",top:"20px",right:"20px",zIndex:999999,background:"#fff",padding:"10px",border:"2px solid #333",borderRadius:"8px",boxShadow:"0 2px 10px rgba(0,0,0,0.3)"});d.innerHTML=%60Current: ${c}
Select target instance:
%60+i.map(x=>%60%60).join("")+%60
Close%60;document.body.appendChild(d);d.querySelectorAll("button").forEach(b=>b.onclick=()=>{const t=b.textContent.trim();window.open(u.replace(c+".service-now.com",t+".service-now.com"),"_blank");d.remove();});d.querySelector("a").onclick=e=>{e.preventDefault();d.remove();};}catch(e){alert("Error: "+e.message);}})(); diff --git a/Specialized Areas/Browser Bookmarklets/Open record in another instance/README.md b/Specialized Areas/Browser Bookmarklets/Open record in another instance/README.md new file mode 100644 index 0000000000..19f22faf47 --- /dev/null +++ b/Specialized Areas/Browser Bookmarklets/Open record in another instance/README.md @@ -0,0 +1,38 @@ +# Open Same Record in Another Instance (Browser Bookmarklet) + +## Description +This bookmarklet allows ServiceNow developers, admins, or QA testers to **quickly open the same record in another instance** (e.g., DEV → TEST → UAT → PROD) without manually searching for the record or typing the URL. + +It is especially useful for: +- Comparing records across environments +- Testing configuration changes +- Debugging workflows or UI policies across instances + +Instead of typing the target instance every time, it provides **clickable buttons** for your predefined instances. + +--- + +## Features +- Detects current instance automatically +- Opens the same record in a **new tab** +- Pop-up overlay with buttons for predefined target instances +- Toggleable: overlay disappears after selecting or closing +- Fully client-side — works on any ServiceNow record page + +--- + +## How to use + +1. Create a new bookmark in your browser. +2. Name it: `Open in Another Instance` +3. In the URL field, paste the bookmarklet code present in [Open Record in Another Instance](./Open%20record%20in%20another%20instance/Open%20record%20in%20another%20instance.js) +4. **Important** In the script, update the instance names with your instances. + For example purpose ["dev12345","test12345","uat12345","prod12345"] are added in the code. +5. Now open any record in any ServiceNow instance and click on the bookmark and select the instance to open. + +Note : Please be noted that this will work for all the ServiceNow instances with URL like https://xxxx.service-now.com +For custom URLs, you need to tweak the code slightly as required. + +SCreenshots: +image +