434 views

Description

The Create story UI action on the Enhancement and Defect tables is updating the Opened field with the incorrect time. Regardless of the time zone selected, records created using this UI action are displaying the current time in the UTC/PST time zone.

Workaround

In the affected UI actions, insert the following at line 23:

var ajax = new GlideAjax('DateTimeFix');
ajax.addParam('sysparm_name','dateTimeFix');
ajax.getXMLWait();
var newTime = ajax.getAnswer();
values["opened_at"] = newTime;

Create a script include called DateTimeFix, client callable, with the following script:

var DateTimeFix = Class.create();

DateTimeFix.prototype = Object.extendsObject(AbstractAjaxProcessor, {

dateTimeFix: function() {
return gs.hoursAgo(14);
}
});

***This tricks the bug by setting the time back 14 hours (two times the PST offset) and results in the opened_at time being set correctly. This would only work for PST, but could be adjusted for other time zones statically, or with additional logic per user TZ. 


Related Problem: PRB586748

Seen In

There is no data to report.

Associated Community Threads

There is no data to report.

Article Information

Last Updated:2014-10-27 11:03:56
Published:2014-01-13