Notifications

81 views

Overview


A customer may notice that the data specified on a scheduled report (sent through email) is not showing the expected date or time range in the output of the report.  For example a report that is intended to show the number of Incidents closed during the last week, may be running and showing data that appears to be showing data including times that are outside that time zone (usually by several hours).

Cause


The usual cause of this issue is because the report is running in the timezone context of the individual populated in the Run as field of the report, while the viewers of the report (who might be in a different timezone) are expecting the report to be running in a different timezone.

Reports which use dynamic values in the query parameters (such as Today, This Week, Last Week, This Month, etc) will resolve the values for these dynamic parameters based on the timezone associated with that Run as user.  If that user has no timezone associated with his profile, the instance will use the system configured timezone (as configured in the glide.sys.default.tz System Property on that instance).  If the Run as user field for that Scheduled Report, the report will run under the Guest user account on the system.  Note that in most versions of ServiceNow the Run as field may not be visible on the form, but this field is, by default, populated with the value of the individual who created the Scheduled Report record.

Resolution


There are a number of ways in which this issue can be resolved, including changing the Run As user associated to the report to be an individual who is in the same timezone as the expected results, changing the Timezone of the Run As per and others, however the most efficient method is to change the actual timezone as associated to the Scheduled Report record.  Similar to the Run As user field, the Run As Timezone field is not, by default, displayed on the Scheduled Report form, thus the administrator will probably want to first display these fields on the Scheduled Report form.  Thus, the following steps can be used to perform this:

Log into the instance with an account having admin rights to the instance.

Open the Scheduled Report record (found in the sysauto_report table) for the Scheduled Report that is reporting with incorrect date and time values.

Click the contextual menu at the upper right corner of the record (commonly known as the Hamburger Menu).

From the pop-up menu that appears, select the option titled Configure.

From the secondary pop-up menu that appears, select Form Layout.

A slushbucket control should appear with fields on the right which are currently found on the form and all other fields from the table which is used to generate the form on the left.

In the list of fields in the list with the label Available, locate the field with the name Run as [+] and double click that field name to move the field to the Selected list.  Repeat for the Run as tz field.  Use the up and down arrows to position the fields as wanted on the form.  If either or both of these fields are already found in the list Selected fields, then no action is needed for that field.

Adjusting the form fields

Click the Save button.

The screen will return to the Scheduled Report record with these fields now displayed on the form.

The Run as field will normally display with the user name of the user who created the Scheduled Report record and the Run as tz will, by default, be set as From Run As User.  This indicates that the Report will run using the timezone as set for the Run as user in calculating dynamic time variables in the scheduled report.

Run as and Run as tz fields displayed

By changing the selected value in the Run as tz field pull-down field, the time zone context in which this report runs in can be changed.  Select the timezone from the pull down you would prefer to have this report run in (i.e. US/Pacific).

Setting the timezone

Click the Update button on the record display form to save the record.

The next run of this report should then run under the context of the selected timezone for the record rather than that of the timezone as associated to the run as user associated to that record.

After performing these steps, if you want to remove the Run as and Run as tz fields from displaying on the form, you can again use the Configuration menu to open the slushbucket for the fields displayed on the form and remove those fields as appropriate.

Article Information

Last Updated:2018-12-21 13:05:41
Published:2018-12-21