Discovery Schedule Page: Discovery status chart date not showing by user selected timezone. issue is showing always UTC datatime.


Description

issue is related to the graph shown in Discovery -> Home -> Schedule

From "Last 10 runs" graph, the date shown a day before. For example graph shown date 5-Nov but the discovery status date was 6-Nov.


Discovery status:






Steps to Reproduce

Prerequest:
Select the anytime zone except US timezone.

1. Navigation > Discovery
2. Click on schedules card from disocvery home page
3. discovery schedule -> select cloud resource card -> discovery status chart
4.Check that date are showing based on user selected timezone date.

Workaround

1. Navigate to System Definition > Script includes from filter navigator
2. Search script includes name "DiscoveryScheduleManager" from the table list view and open this record.
4. Search method name => getDiscoveryStatus and find the below line,
discoveryStatus.push ({

5. Find the below lines and Replace it(i.e. replace "getValue" to "getDisplayValue")

Before modified:
started: statusGr.getValue('sys_created_on'),
ended: statusGr.getValue('sys_updated_on'),

After modified:
started: statusGr.getDisplayValue('sys_created_on'),
ended: statusGr.getDisplayValue('sys_updated_on'),


6. Just check that modified code look like as below,
discoveryStatus.push ({
sysId : statusGr.getValue('sys_id'),
name: statusGr.getValue('number'),
state: statusGr.getValue('state'),
started: statusGr.getDisplayValue('sys_created_on'),
ended: statusGr.getDisplayValue('sys_updated_on'),
card1: card1,
card2: card2,
card3: card3,
card4: card4,
errors: this.getAllErrorsForStatus(statusGr.getValue('sys_id'))
});


7. Save the record.


8. Similarly, search and open Script Include DiscoveryResultManager


9. Search for function: getInProgressDiscoveries around line 46

Inside this function, it has below line around line 63

createdOn: statusGr.sys_created_on +'',

change it to:

createdOn: statusGr.getDisplayValue('sys_created_on')+'',


10. In same script include, search for function: getResultsForSchedule around line 527

Inside this function, it has below lines around line 566

started: resultGr.getValue('sys_created_on'), 
startedDate: resultGr.started.getValue() +'', 
ended: resultGr.getValue('sys_updated_on'), 

change these to:

started: resultGr.getDisplayValue('sys_created_on'), 
startedDate: resultGr.getDisplayValue('started') +'', 
ended: resultGr.getDisplayValue('sys_updated_on'), 


Related Problem: PRB1447917