Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
**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.
1. Added "open in Workspace" Button to open the record in workspace(defined in option schema), 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.
4. This button wll look for the table to workspace mapping (in option schema) and create the URL to open record in respective workspace. If now mapping is found, the record is opened in SOW workspace(default).
5. The button name has been changed to generic title "Open In Workspace"

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.
**Sample**
{
"name":"define_workspace",
"type":"json",
"label":"Define Table Workspace JSON Mapping",
"value":{
"sn_grc_issue":"risk/privacy", // will open issue records in RISK workspace
"sn_si_incident":"sir" // will open security incidents in SIR workspace.
}
}

Widget will create a button that will only be visible 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.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div>
<span class="btn-cntr" ng-if="::data.role==true">
<a href="{{::data.platform_url}}" target='_blank'class='btn btn-default'>{{::options.open_in_platform}}</a><br> <!--Platform button configuration-->
<a href="{{::data.sow_url}}" target='_blank'class='btn btn-default'>{{::options.open_in_sow}}</a> <!--SOW button configuration-->
<a href="{{::data.workspace_url}}" target='_blank'class='btn btn-default'>{{::options.open_in_workspace}}</a> <!--Workspace button-->
</span>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,18 @@
"default_value":"Open in Platform"
},
{
"name":"open_in_sow",
"name":"open_in_workspace",
"type":"string",
"label":"Name for SOW Button",
"default_value":"Open in SOW"
"label":"Name for Workspace Button",
"default_value":"Open In workspace"
},
{
"name":"define_workspace",
"type":"json",
"label":"Define Table Workspace JSON Mapping",
"value":{
"sn_grc_issue":"risk/privacy",
"sn_si_incident":"sir"
}
}
]
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
(function() {
/*
Code will get table and sys_id parameter from url and create url for platform and sow.
Code will get table and sys_id parameter from url and create url for platform and workspace(defined in option schema).
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.table = $sp.getParameter("table"); // get table from url
data.sys_id = $sp.getParameter("sys_id"); // get sys_id from url

var tableWorkspaceMapping = JSON.parse(options.define_workspace); // get the table to workspace mapping from instance options.
Object.keys(tableWorkspaceMapping).forEach(function(key) {
if (key == data.table)
data.workspace_url = "now/" + tableWorkspaceMapping[key] + "/record/" + data.table + "/" + data.sys_id; // if table to workspce mapping is found, the create workspace URL.
else
data.workspace_url = "now/sow/record/" + data.table + "/" + data.sys_id; // open in SOW
});
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.
Expand Down
Loading