- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-06-2020 09:56 AM
Good afternoon community,
I am attempting to add a displayed field to the TICKET FIELDS widget on the portal. I have the field added (DUE_DATE), by editing the server script side to include it, but when it is displayed on the portal, it is not displaying the due date, but for some reason showing JUST NOW (actual data in field is "1/10/2020 08:11:58 AM")-
I am little stumped since the date created is correct... do I need to have it display the display value instead somehow, or is there something else I can do?
Thanks everyone!
Jeff
Solved! Go to Solution.
- Labels:
-
User Interface (UI)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-12-2020 08:39 AM
Hey all, I think I can assist with this.
So you have this section (around line 16 or so):
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'));
Now right below this, add this in (and just shift everything else that was already here down):
for(var i = 0; i < fields.length; i++) {
if(fields[i].label == "Due date")
fields[i].type = "string";
}
And that should be all you need.
So final could look somewhat like this:
var fields = $sp.getFields(gr, 'number,u_item_name,priority,category,state,subcategory,stage,u_reject_code,due_date,u_reject_reason,sys_created_on');
if (gr.getValue("sys_mod_count") > 0)
fields.push($sp.getField(gr, 'sys_updated_on'));
for(var i = 0; i < fields.length; i++) {
if(fields[i].label == "Due date")
fields[i].type = "string";
}
Please mark reply as Helpful/Correct, if applicable. Thanks!
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
‎01-06-2020 10:06 AM
Hi,
Can you kindly help with the script tweaked for the widget.
Thanks,
Jaspal Singh
Hit Helpful or Correct on the impact of response.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-06-2020 11:38 AM
On the TICKET FIELDS widget, I edited the fields line near the top and just added due_date into it like I did the other fields I wanted in there-
---
(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,incident_state,stage,priority,sys_created_on,due_date,cat_item');
---
More below that, but that last line is what I added to the OOB widget.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-06-2020 12:33 PM
This is on the SERVER section by the way.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-12-2020 02:20 AM
Hi Jeff,
I have got the same issue. Did you manage to get any further with this?
Thanks
Steve