From 92b184bc2240bb02afd93d2cadc63930e170cf27 Mon Sep 17 00:00:00 2001 From: Raghav Sharma <53517312+raghavs046@users.noreply.github.com> Date: Fri, 10 Oct 2025 18:26:21 +0530 Subject: [PATCH 1/8] Create test.js --- Specialized Areas/Fix scripts/test.js | 1 + 1 file changed, 1 insertion(+) create mode 100644 Specialized Areas/Fix scripts/test.js diff --git a/Specialized Areas/Fix scripts/test.js b/Specialized Areas/Fix scripts/test.js new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/Specialized Areas/Fix scripts/test.js @@ -0,0 +1 @@ + From f0add90e292d47924110b758d3e0a1c123b4abb5 Mon Sep 17 00:00:00 2001 From: Raghav Sharma <53517312+raghavs046@users.noreply.github.com> Date: Fri, 10 Oct 2025 18:27:02 +0530 Subject: [PATCH 2/8] Delete Specialized Areas/Fix scripts/test.js --- Specialized Areas/Fix scripts/test.js | 1 - 1 file changed, 1 deletion(-) delete mode 100644 Specialized Areas/Fix scripts/test.js diff --git a/Specialized Areas/Fix scripts/test.js b/Specialized Areas/Fix scripts/test.js deleted file mode 100644 index 8b13789179..0000000000 --- a/Specialized Areas/Fix scripts/test.js +++ /dev/null @@ -1 +0,0 @@ - From da2102c1a0b14c433c09f5156a1a0dc765d328f6 Mon Sep 17 00:00:00 2001 From: Raghav Sharma <53517312+raghavs046@users.noreply.github.com> Date: Thu, 16 Oct 2025 18:49:11 +0530 Subject: [PATCH 3/8] Update server.js --- .../Open in Platform/server.js | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/Modern Development/Service Portal Widgets/Open in Platform/server.js b/Modern Development/Service Portal Widgets/Open in Platform/server.js index f94e939a90..a37e738081 100644 --- a/Modern Development/Service Portal Widgets/Open in Platform/server.js +++ b/Modern Development/Service Portal Widgets/Open in Platform/server.js @@ -1,11 +1,16 @@ (function() { - data.table = input.table || $sp.getParameter("table"); - data.sys_id = input.sys_id || $sp.getParameter("sys_id"); - - data.url = "/nav_to.do?uri="+data.table+".do?sys_id="+data.sys_id; - - data.role = false; - if (gs.hasRole("itil")){ - data.role = true; - } + /* + Code will get table and sys_id parameter from url and create url for platform and sow. + This widget can be used in any page having sys_id and table in url , eg: ticket page. + */ + data.table = input.table || $sp.getParameter("table"); // get table from url + data.sys_id = input.sys_id || $sp.getParameter("sys_id"); // get sys_id from url + + data.platform_url = "/nav_to.do?uri=" + data.table + ".do?sys_id=" + data.sys_id; + data.sow_url = "now/sow/record/" + data.table + "/" + data.sys_id; + + data.role = false; + if (gs.hasRole("itil") && data.table && data.sys_id) { // only visible to users with itil role and if url has required parameters. + data.role = true; + } })(); From 7ec638a7abb77e43e77b54aa9d930252fb2e481d Mon Sep 17 00:00:00 2001 From: Raghav Sharma <53517312+raghavs046@users.noreply.github.com> Date: Thu, 16 Oct 2025 18:50:21 +0530 Subject: [PATCH 4/8] Update body.html --- .../Service Portal Widgets/Open in Platform/body.html | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Modern Development/Service Portal Widgets/Open in Platform/body.html b/Modern Development/Service Portal Widgets/Open in Platform/body.html index 507dbb3fc9..7e005923dc 100644 --- a/Modern Development/Service Portal Widgets/Open in Platform/body.html +++ b/Modern Development/Service Portal Widgets/Open in Platform/body.html @@ -1,5 +1,6 @@
From 20a33be43abedaff2ecc03d3126ae074a223e803 Mon Sep 17 00:00:00 2001 From: Raghav Sharma <53517312+raghavs046@users.noreply.github.com> Date: Thu, 16 Oct 2025 18:50:57 +0530 Subject: [PATCH 5/8] Create option schema.js --- .../Open in Platform/option schema.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 Modern Development/Service Portal Widgets/Open in Platform/option schema.js diff --git a/Modern Development/Service Portal Widgets/Open in Platform/option schema.js b/Modern Development/Service Portal Widgets/Open in Platform/option schema.js new file mode 100644 index 0000000000..825d260ce8 --- /dev/null +++ b/Modern Development/Service Portal Widgets/Open in Platform/option schema.js @@ -0,0 +1,14 @@ +[ +{ +"name":"open_in_platform", +"type":"string", +"label":"Name for Plarform Button", +"default_value":"Open in Platform" +}, +{ +"name":"open_in_sow", +"type":"string", +"label":"Name for SOW Button", +"default_value":"Open in SOW" +} +] From 134d838becb8fa90206ce7a4dd1ba117260bf7e0 Mon Sep 17 00:00:00 2001 From: Raghav Sharma <53517312+raghavs046@users.noreply.github.com> Date: Thu, 16 Oct 2025 18:51:19 +0530 Subject: [PATCH 6/8] Create css.js --- .../Service Portal Widgets/Open in Platform/css.js | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 Modern Development/Service Portal Widgets/Open in Platform/css.js diff --git a/Modern Development/Service Portal Widgets/Open in Platform/css.js b/Modern Development/Service Portal Widgets/Open in Platform/css.js new file mode 100644 index 0000000000..ed4e26f29a --- /dev/null +++ b/Modern Development/Service Portal Widgets/Open in Platform/css.js @@ -0,0 +1,7 @@ +/* +This styling will align buttons on 2 ends of the div. +*/ +.btn-cntr{ +display: flex; +justify-content: space-between; +} From fa1a9c98fcf35ea78ae0cc64c8de41ee1559e5cd Mon Sep 17 00:00:00 2001 From: Raghav Sharma <53517312+raghavs046@users.noreply.github.com> Date: Thu, 16 Oct 2025 18:54:20 +0530 Subject: [PATCH 7/8] Update README.md --- .../Service Portal Widgets/Open in Platform/README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Modern Development/Service Portal Widgets/Open in Platform/README.md b/Modern Development/Service Portal Widgets/Open in Platform/README.md index ec67b8ff50..c5fe2bde75 100644 --- a/Modern Development/Service Portal Widgets/Open in Platform/README.md +++ b/Modern Development/Service Portal Widgets/Open in Platform/README.md @@ -1,3 +1,6 @@ -Widget will create a button that will only be visable to users with the itil role that will take them to the same record in platform. will work with the form and standard ticket pages (or anywhere with the table and sysId in the url. +**This is an enhamncement to the current code** +1. Added "open in SOW" Button to open the record in service operations workspace, since it is gaining popularity now. +2. Enhanced the visibility condition so that the button is only visible on pages having sys_id and table in url. +3. Enhanced css to improve visibility of button. -see also [on Share](https://developer.servicenow.com/connect.do#!/share/contents/6592535_open_in_platform_widget?t=PRODUCT_DETAILS) +Widget will create a button that will only be visable to users with the itil role that will take them to the same record in platform. will work with the form and standard ticket pages (or anywhere with the table and sysId in the url. From fed7521659abf7a0a10fbfcb2c5ede2e55f6e6fc Mon Sep 17 00:00:00 2001 From: Raghav Sharma <53517312+raghavs046@users.noreply.github.com> Date: Thu, 16 Oct 2025 19:59:17 +0530 Subject: [PATCH 8/8] Update README.md --- .../Service Portal Widgets/Open in Platform/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modern Development/Service Portal Widgets/Open in Platform/README.md b/Modern Development/Service Portal Widgets/Open in Platform/README.md index c5fe2bde75..0104fafdd2 100644 --- a/Modern Development/Service Portal Widgets/Open in Platform/README.md +++ b/Modern Development/Service Portal Widgets/Open in Platform/README.md @@ -1,4 +1,4 @@ -**This is an enhamncement to the current code** +**This is an enhancement to the current code** 1. Added "open in SOW" Button to open the record in service operations workspace, since it is gaining popularity now. 2. Enhanced the visibility condition so that the button is only visible on pages having sys_id and table in url. 3. Enhanced css to improve visibility of button.