Report to get changed CI details along with changed values and related task details

Ashroba Ujagare
Tera Contributor

Hello All,

 

Hope you are doing well!

We are in need of report to show CI changed details along with values changed and related task details like change number change status.

 

As far I know CI changed details along with CI , change number and its status are recorded in task_ci (affected CI) table however requirement is to get what changes has been done to CI's as part change management process.

 

E.g. Change raised to upgrade RAM and changed RAM value needs to be displayed on single row in report along with CI, Change number & status details.

 

Please suggest your ideas or solutions to achieve this, Immediate responses will be helpful and highly appreciated.

 

Thank you in advance!

 

Best Regards,

Ashroba U

1 REPLY 1

_ukasz Rybicki
Giga Guru

Problem Name: Missing changed CI values in Change Request report 🚧

General solution (≤100 words):
Use the CIs Affected (task_ci) table as your report source, enable auditing on the relevant CMDB tables to capture old and new CI attribute values, then join or dot-walk into audit/history tables (sys_audit or sys_history_line) to display the changed values alongside Change Request number and status. For high-volume environments, leverage History Sets or the Metrics feature to avoid performance issues. 🔍📊 (ServiceNow, ServiceNow, ServiceNow, ServiceNow)


Detailed solution step-by-step (≤250 words):

  1. Enable auditing on your CI table(s):

    • Navigate to System Definition > Tables & Columns, open e.g. cmdb_ci_computer, check Audit.

    • This records every field change, storing field name, old/new values, timestamp, and user in sys_audit (ServiceNow).

  2. Create a new report using the CIs Affected (task_ci) table:

    • Go to Reports > Create New, set Table = CIs Affected.

    • Add a filter: Task number starts with CHG (Change Requests only). (ServiceNow)

  3. Add required columns:

    • CI name: dot-walk from ci_item.name.

    • Change number, Change state: from parent task fields.

    • Field name, New Value, Old Value: from sys_audit.

  4. Surface Old Value via script (simple if-else):

    // In a report script field for Old Value
    var gr = new GlideRecord('sys_audit');
    gr.addQuery('documentkey', current.ci_item.sys_id);
    gr.addQuery('fieldname', 'ram');      // or dynamic field
    gr.orderByDesc('sys_created_on');
    gr.setLimit(1);
    gr.query();
    if (gr.next()) current.old_value = gr.oldvalue;

    – keep code short and commented (ServiceNow).

  5. Alternative no-code approach:

    • Database View combining task_ci → sys_audit on documentkey = ci_item and sys_audit.fieldname filter.

    • Build report on that view to avoid scripting. (ServiceNow)

  6. Optimize for performance:

    • Use History Sets (sys_history_line) instead of sys_audit; pre-generate history for CIs changed in last 24h via scheduled job, then report on sys_history_line (ServiceNow).

    • Or enable Platform Metrics on your CI table to track specific fields without querying system tables (ServiceNow, ServiceNow).


Example solution (≤100 words):
A Change Manager can schedule a dashboard widget that reports on all CI RAM upgrades by creating a report on CIs Affected (task_ci), filtering Task number = CHG*, adding columns for CI name, Change number, State, Field name = “ram” and script-driven Old/New values from sys_audit. This provides a single-row view per Change showing the CI, its previous RAM, new RAM, and change status. 🖥📋


Sources:

  1. Report on Affected CI table & Change Request, ServiceNow Community (shows using task_ci table for Change CI reports) (ServiceNow)

  2. A report for check the CMDB attribute changed and it’s value, ServiceNow Community (demonstrates leveraging sys_audit for old/new values) (ServiceNow)

  3. Re: Create a report for CIs, ServiceNow Community (set Table to CIs Affected in report builder) (ServiceNow)

  4. Reporting on Field Changes for CMDB, ServiceNow Community (recommends Platform Metrics) (ServiceNow)

  5. Tracking CI Record History, ServiceNow Community (use sys_history_line for efficient history reporting) (ServiceNow)

  6. Differences Between Audit and History Sets, ServiceNow Docs (details sys_audit vs sys_history_line performance) (ServiceNow)

  7. Create report with table 'sys_audit' and display meaningful value, ServiceNow Community (advocates Metrics over sys tables) (ServiceNow)

  8. A report for check the CMDB attribute changed and it’s value, ServiceNow Community (Rajesh Singh’s audit-based steps) (ServiceNow)

  9. Track any "Modification of CI through ServiceNow report", ServiceNow Community (baseline snapshot approach) (ServiceNow)

  10. Re: Create a report for CIs, ServiceNow Community (Robbie’s dashboard/aggregation tips) (ServiceNow)

Please mark as correct answer if this helps! 👍