Ticket Fields widget does not show on Ticket form for non-roled users

SNAdmin47
Kilo Sage

Hi, When using the service portal I'm getting some strange behaviour on the ticket fields widget on the 'ticket form' page which is used for 3 different tables, incident, change request and a bespoke table called 'requests' (bespoke table). This is on the OOTB ticket fields widget so there's no customisation applied and it's the same page being used, i.e., 'Ticket Form'.

 

The widget works fine for all users when the ticket form is viewing a record on the incident table... all users can see the 'Options' link which then opens up the section to contain all the variables included in the submission via the portal:

GabeCardiff1_0-1669650180872.png

 

However, when I use the ticket form for any of the other ticket types (change request and 'request') for some reason the 'Options' drop down to show the variables on the submission don't appear when being viewed by a customer user (i.e., no roles), but will show for any internal user with roles.

 

As a customer user with no roles:

 

GabeCardiff1_1-1669650245646.png

As an internal user with basic itil roles: 

GabeCardiff1_2-1669650310924.png

I've tried going through the widget code on a line by line basis (but I'm not great at html) and I've also tried reviewing the widget config on the instance but I can't see anything which would suggest the content is being controlled/manipulated for roles/no-roles. It's the same form and widget in use across all 3 different ticket types, so I'm at a loss to identify why/how this is happening.

 

Has anybody had any similar experience and/or have an understanding of why this is happening?

 

The HTML code is below:

hnj<div ng-if="data.canRead" class="panel b">
<div class="panel-heading bg-primary panel-la-jolla-default">
<div ng-init="spSearch.targetRequests()">
<sp-c-link target="form" table="data.table" id="data.sys_id"/>
</div>
<h2 class="sr-only">${Ticket details}</h2>
<span ng-if="data.agent" >
${Agent working on this {{data.tableLabel}}}:
<div>{{data.agent}}</div>
</span>
<span aria-live="assertive">
<span ng-if="!data.agent && data.agentPossible" >${Your request has been submitted}</span>
</span>
<span ng-if="!data.agentPossible">${{{data.tableLabel}} record details}</span>
</div>

<div class="panel-body">
<dl class="ticket-fields" ng-if="data.fields.length > 0">
<dt class= "col-md-6 col-sm-12 col-xs-6 break-word"
ng-if="field.value && (field.type != 'decimal' || field.type == 'decimal' && field.value != 0)"
ng-repeat-start="field in data.fields">{{field.label}}</dt>
<dd class= "col-md-6 col-sm-12 col-xs-6 break-word"
ng-repeat-end ng-switch="field.type"
ng-if="field.value && (field.type != 'decimal' || field.type == 'decimal' && field.value != 0)">
<div ng-switch-when="glide_date_time" title="{{field.display_value}}">
<sn-time-ago timestamp="::field.value" />
</div>
<div ng-switch-when="multi_small"><pre class="multi-lines">{{field.display_value}}</pre></div>
<div ng-switch-default><span class="pre-wrap">{{field.display_value}}</span></div>

</dd>
</dl>
<sp-widget widget="data.variableSummarizerWidget"></sp-widget>
</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>

 

The client script is below:

function ($scope, spUtil) {
spUtil.recordWatch($scope, $scope.data.table, "sys_id=" + $scope.data.sys_id);
}

 

The server script is below:

(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,opened_by,watch_list, description');
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 = new GlobalServiceCatalogUtil().getVariablesForTask(gr, true);
data.agent = agent;
data.agentPossible = gr.isValidField("assigned_to");
data.table = gr.getTableName();
data.sys_id = gr.getUniqueValue();
data.variableSummarizerWidget = $sp.getWidget('sc-variable-summarizer', {'variables' : data.variables, 'toggle' : true, 'task' : fields[0].value});
})()

 

=======================

 

Many thanks in advance for any input offered

 

 

 

3 REPLIES 3

Mohith Devatte
Tera Sage
Tera Sage

Hello @SNAdmin47 ,

Type in ticket configuration and open the module .

Screenshot 2022-11-28 at 22.05.57.png

Then open the record for  RITM table and scroll down to related lists 

Screenshot 2022-11-28 at 22.06.09.png

After opening scroll down and open additional details record and check if there is any visible condition given to the record 

Screenshot 2022-11-28 at 22.06.16.png

 

Follow the same thing for change table too

 

Hope this helps 

Mark my answer correct if this helps you 

Thanks

 

Brilliant, thanks @Mohith Devatte , I'm looking now.... really appreciate the quick response and I'll be sure to let you know how I get on 🙂 

Sure thing  @SNAdmin47 .