Demo data for performance Analytics Module

juan13
Giga Contributor

Is there a way to populate demo data into PA module to display data on dashboards? and any method to update the data/time so the data isn't stale

3 REPLIES 3

Community Alums
Not applicable

Hi Juan,

I have attached the XML files here.

update_demo_data_dates_20141006.xml is an update set you need to load, preview and commit. It contains a scheduled job that will update the incident dates.

  • incident_demo_data_20141006.xml contains 9494 incident records. Just use Import XML from a table menu and load the records.
  • incident_demo_data_20141006.xml.zip1.42M
     
  • update_demo_data_dates_20141006.xml.zip1.56K
     
     
     
     
    Mark my answer correct & Helpful, if Applicable.

    Thanks,

    Sandeep

Hello!! Thanks for the files!

the update set went well but with the xml of the incidents the following error message appeared (Error MessageData Policy Exception: The following fields are mandatory: Resolution code, Close notes), can you tell me how to fix it?

 

thanks !!

Hey Juan,

 

I dont think that you still have that problem, but you need to deactivate the data policy "Make close info mandatory when resolved or closed" before you import the incidents. You can then activate it again after the import.

 

After this you can run this code to add resolution codes and close notes:

 

var resolutionArray = ['Duplicate', 'Known error', 'No resolution provided', 'Resolved by caller', 'Resolved by change', 'Resolved by problem', 'Resolved by request', 'Solution provided', 'Workaround provided', 'User error'];

var random = 0;

var incGR = new GlideRecord('incident');
incGR.addEncodedQuery('stateIN6,7'); //closed and resolved
incGR.query();

while (incGR.next()) {
    random = Math.floor(Math.random() * resolutionArray.length); //picks a random number from 0 to array length
    incGR.close_code = resolutionArray[random]; //picks a random resolution code from the array
    incGR.close_notes = 'closed and happy'; //you can also randomize this but it wasnt needed in my case
    incGR.autoSysFields(false); //updated and updated by doesnt get filled
    incGR.setWorkflow(false); //prevent Business Rules from triggering
    incGR.update();
}