- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2018 09:34 AM
We recently went live with Service Portal for one of our customers and they noticed that when creating an incident via a record producer, the "options" (variables) are only visible by the "opened by" user. There is a need to allow Watch List users to see this information.
I have tried modifying the widget by updating the line that toggles the display by removing the "IF". This allowed the "options" glyphicon to display, but no data was displayed below it:
<!-- <div ng-if="data.variables.length > 0" ng-init="c.variable_toggle = true"> -->
<div ng-init="c.variable_toggle = true">
So, i figured this must be an ACL restriction, however looking at the OOTB ACLs, there is only one ACL for the question_answer table and modifying (and even deleting) did not seem to allow the variables to display. Even more perplexing is the fact that even ADMIN's cannot see the data...
See screenshots below. Is this a further ACL problem i am facing or is the issue in the widget?
Solved! Go to Solution.
- Labels:
-
Service Portal

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2018 07:49 AM
Sure, this is the OOTB Ticket Fields widget for Kingston:
HTML
<div ng-if="data.canRead" class="panel b">
<div class="panel-heading bg-primary">
<div ng-init="spSearch.targetRequests()">
<sp-c-link target="form" table="data.table" id="data.sys_id"/>
</div>
<span ng-if="data.agent" >
${Agent working on this {{data.tableLabel}}}:
<div>{{data.agent}}</div>
</span>
<span ng-if="!data.agent && data.agentPossible" >${Your request has been submitted}</span>
<span ng-if="!data.agentPossible">${{{data.tableLabel}} record details}</span>
</div>
<div class="panel-body">
<div ng-if="data.fields.length > 0">
<div class="row">
<div class="col-md-6 col-sm-12 col-xs-6 m-b break-word" ng-repeat="field in data.fields"
ng-if="field.value && (field.type != 'decimal' || field.type == 'decimal' && field.value != 0)" >
<label class="m-n">{{field.label}}</label>
<span ng-switch="field.type">
<div ng-switch-when="glide_date_time" title="{{field.display_value}}">
<sn-time-ago timestamp="::field.value" />
</div>
<div ng-switch-default >{{field.display_value}}</div>
</span>
</div>
</div>
</div>
<div ng-if="data.variables.length > 0" ng-init="c.variable_toggle = true">
<button class="h4 options-btn" ng-click="c.variable_toggle = !c.variable_toggle" aria-expanded="{{c.variable_toggle}}" aria-controls="variables-toggle">
<span style="font-size: 12px;" class="glyphicon" ng-class="c.variable_toggle ? 'glyphicon-chevron-down' : 'glyphicon-chevron-up'"></span>
${Options}
</button>
<div ng-if="c.variable_toggle" id="variables-toggle" aria-hidden="{{!c.variable_toggle}}">
<hr role="presentation">
<div class="m-b break-word" ng-repeat="variable in data.variables | filter:{visible_summary:true}">
<label class="m-n">{{variable.label}}</label>
<div>{{variable.display_value}}</div>
</div>
</div>
</div>
</div>
<div ng-if="data.agentPossible && !data.agent && options.pickup_msg" class="panel-footer">
<div id="ticket_fields_footer" class="text-center text-muted" style="font-style: italic;" ng-bind-html="data.pickupMsg">
</div>
</div>
</div>
CSS
.options-btn {
border:none;
background-image:none;
background-color:transparent;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
}
Client Script
function ($scope, spUtil) {
spUtil.recordWatch($scope, $scope.data.table, "sys_id=" + $scope.data.sys_id);
}
Server Script
(function(){
data.pickupMsg = gs.getMessage(options.pickup_msg);
var gr = $sp.getRecord();
if (gr == null)
return;
data.canRead = gr.canRead();
if (!data.canRead)
return;
var agent = "";
var a = $sp.getField(gr, 'assigned_to');
if (a != null)
agent = a.display_value;
var fields = $sp.getFields(gr, 'number,state,priority,sys_created_on');
if (gr.getValue("sys_mod_count") > 0)
fields.push($sp.getField(gr, 'sys_updated_on'));
if (gr.getValue('price') > 0)
fields.push($sp.getField(gr, 'price'));
if (gr.getValue('recurring_price') > 0) {
var rp = $sp.getField(gr, 'recurring_price');
if (gr.isValidField("recurring_price"))
rp.display_value = rp.display_value + " " + gr.getDisplayValue("recurring_frequency");
fields.push(rp);
}
if (gr.isValidField("quantity"))
fields.push($sp.getField(gr, 'quantity'));
data.tableLabel = gr.getLabel();
data.fields = fields;
data.variables = $sp.getVariablesArray();
data.agent = agent;
data.agentPossible = gr.isValidField("assigned_to");
data.table = gr.getTableName();
data.sys_id = gr.getUniqueValue();
})()
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2018 07:49 AM
Sure, this is the OOTB Ticket Fields widget for Kingston:
HTML
<div ng-if="data.canRead" class="panel b">
<div class="panel-heading bg-primary">
<div ng-init="spSearch.targetRequests()">
<sp-c-link target="form" table="data.table" id="data.sys_id"/>
</div>
<span ng-if="data.agent" >
${Agent working on this {{data.tableLabel}}}:
<div>{{data.agent}}</div>
</span>
<span ng-if="!data.agent && data.agentPossible" >${Your request has been submitted}</span>
<span ng-if="!data.agentPossible">${{{data.tableLabel}} record details}</span>
</div>
<div class="panel-body">
<div ng-if="data.fields.length > 0">
<div class="row">
<div class="col-md-6 col-sm-12 col-xs-6 m-b break-word" ng-repeat="field in data.fields"
ng-if="field.value && (field.type != 'decimal' || field.type == 'decimal' && field.value != 0)" >
<label class="m-n">{{field.label}}</label>
<span ng-switch="field.type">
<div ng-switch-when="glide_date_time" title="{{field.display_value}}">
<sn-time-ago timestamp="::field.value" />
</div>
<div ng-switch-default >{{field.display_value}}</div>
</span>
</div>
</div>
</div>
<div ng-if="data.variables.length > 0" ng-init="c.variable_toggle = true">
<button class="h4 options-btn" ng-click="c.variable_toggle = !c.variable_toggle" aria-expanded="{{c.variable_toggle}}" aria-controls="variables-toggle">
<span style="font-size: 12px;" class="glyphicon" ng-class="c.variable_toggle ? 'glyphicon-chevron-down' : 'glyphicon-chevron-up'"></span>
${Options}
</button>
<div ng-if="c.variable_toggle" id="variables-toggle" aria-hidden="{{!c.variable_toggle}}">
<hr role="presentation">
<div class="m-b break-word" ng-repeat="variable in data.variables | filter:{visible_summary:true}">
<label class="m-n">{{variable.label}}</label>
<div>{{variable.display_value}}</div>
</div>
</div>
</div>
</div>
<div ng-if="data.agentPossible && !data.agent && options.pickup_msg" class="panel-footer">
<div id="ticket_fields_footer" class="text-center text-muted" style="font-style: italic;" ng-bind-html="data.pickupMsg">
</div>
</div>
</div>
CSS
.options-btn {
border:none;
background-image:none;
background-color:transparent;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
}
Client Script
function ($scope, spUtil) {
spUtil.recordWatch($scope, $scope.data.table, "sys_id=" + $scope.data.sys_id);
}
Server Script
(function(){
data.pickupMsg = gs.getMessage(options.pickup_msg);
var gr = $sp.getRecord();
if (gr == null)
return;
data.canRead = gr.canRead();
if (!data.canRead)
return;
var agent = "";
var a = $sp.getField(gr, 'assigned_to');
if (a != null)
agent = a.display_value;
var fields = $sp.getFields(gr, 'number,state,priority,sys_created_on');
if (gr.getValue("sys_mod_count") > 0)
fields.push($sp.getField(gr, 'sys_updated_on'));
if (gr.getValue('price') > 0)
fields.push($sp.getField(gr, 'price'));
if (gr.getValue('recurring_price') > 0) {
var rp = $sp.getField(gr, 'recurring_price');
if (gr.isValidField("recurring_price"))
rp.display_value = rp.display_value + " " + gr.getDisplayValue("recurring_frequency");
fields.push(rp);
}
if (gr.isValidField("quantity"))
fields.push($sp.getField(gr, 'quantity'));
data.tableLabel = gr.getLabel();
data.fields = fields;
data.variables = $sp.getVariablesArray();
data.agent = agent;
data.agentPossible = gr.isValidField("assigned_to");
data.table = gr.getTableName();
data.sys_id = gr.getUniqueValue();
})()
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2018 05:20 AM
Yep, that widget worked... the only tweak we had added was a few more fields in the main section (server line 16), which i will re-add and re-test, but it looks like this version will do the job (even ESS users on watch list can now see options):
var fields = $sp.getFields(gr, 'number,state,priority,sys_created_on,cmdb_ci,category,subcategory');
I will try to follow up with a diff check between the two widgets, but i am out of time to deliver this to the customer
😮
Thanks for the helpful (and correct) response !

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2018 05:35 AM
Hi,
No problem. Thanks for the marking my post both helpful and correct. Glad you were able to deliver though. If you need anything else let me know!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!