Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Enable Metrics and State Duration in Case table

UtsavDattani
Mega Contributor

Hi,
I want to create a metric for reporting on Case State Duration, but while defining the metric for the Customer Case and Technical Case tables, I’m unable to select the table values.

Is there a way to enable metric definition for these tables?

3 REPLIES 3

Bert_c1
Kilo Patron

For the Customer Case table, set your Application Scope to 'Customer Service', then create the metric. I don't have the Technical Case table to test, but the solution is probable the same.

nityabans27
Kilo Patron

Hi @UtsavDattani,

Step-by-step: Enable Metrics for CSM Case tables

  1. Go to:
    System Definition → Tables

  2. Open the table record:

    • sn_customerservice_case (Customer Case)

    • sn_customerservice_technical_case (Technical Case)

  3. Check the field:
    Extensible or Metric tracking (depends on version — in Yokohama it’s “Metric tracking”).

  4. Enable it:

    • Tick Metric tracking enabled

    • Save the record

    This flag adds the hidden metric infrastructure needed for that table.

  5. Reload Metric Definition form:

    • Now when you go to Metric Definitions → New,
      you should be able to select those tables from the Table dropdown.

  6. (Optional) If you still don’t see them:

    • Navigate to System Definition → Tables & Columns

    • Open the same table → Check the Extensible box as well.

    • Save and reload again.


⚙️ How it works

ServiceNow stores metrics in the metric_instance and metric_definition tables, but it only generates those when the target table has metric tracking enabled.
Without that flag, metric definitions simply hide the table.


🧠 Extra Tip

If you plan to track state durations, use:

  • Field: state

  • Type: Duration

  • Calculation: Time in State

That will let you build reports like “Average time a Case stays in ‘Awaiting Customer’.”

Bert_c1
Kilo Patron

Hmm, there is the OOB Metric 'Case State Transition' that works without any of the above. I'm a Zurich Patch 1.  And just setting the Application Scope from "Global" to "Customer Service" allowed the creation of new metric definitions for the sn_customerservice_case table.

 

That metric definition can be copied and change the table to another in the same application scope.