Ageing report for custom application

Prudhvi Raj Y
Tera Expert

I have a requirement where we have a record producer which creates a request on the custom table, next approval will get attached, once approved few child tasks will get created and each child task will get approvals attached. Once all the child tasks approved workflow goes back to the main request and attach another approval. In this process approver can assign back the request to requestor for additional clarifications which will change the status of the request.

Now the request is to pull the request of the Main request and child tasks to see how long the request was in each state. Is there a way to set-up the logic to create the report.

 

Thanks in advance.

Prudhvi 

1 ACCEPTED SOLUTION

Hi @Prudhvi Raj Y ,

 

your custom table is extending Task table?

Please do below checks

If metric instances are not being created in ServiceNow after defining a metric, several factors could be missing or incorrectly configured:
 
  • Table Extension:
    Out-of-the-box ServiceNow metrics primarily function on tables that extend the Task table. If your request table does not extend Task, you may need to modify the "metrics events" Business Rule to include your specific table. This rule is responsible for triggering metric instance creation.
  • Metric Definition Configuration:
    • Field: Ensure the "Field" selected in your metric definition correctly points to the status field you are changing on the request.
    • Script: If you are using a script in your metric definition, verify its logic. Ensure it correctly identifies the conditions for metric instance creation and accurately captures the start and end values/timestamps.
    • Calculation Script: If you intend to calculate duration or other values, ensure the calculation script is correctly defined and the "Calculation Complete" field is being set to true when the metric instance should be considered complete.
  • "metric update events process" Scheduled Job:
    This job processes the events that lead to metric instance creation. If this job is not running or its "Next action" date is in the future, metric instances will not be generated. Verify the job's status and schedule.
  • Business Rule Configuration (for custom tables):
    If your request table is not a Task extended table, you may need to:
    • Locate the "metrics events" Business Rule (under Metrics > Business Rules).
    • Copy this Business Rule.
    • Change the "Table" field of the copied Business Rule to your specific request table.
    • Ensure the "When" and "Conditions" of this new Business Rule align with when you want metric instances to be created (e.g., after update, when status changes).
  • ACLs/Permissions:
    Ensure the user performing the status change has the necessary permissions to create records in the metric_instance table.
  • Existing Records:
    Metric instances are typically created upon record insertion or update, not for pre-existing records. If you are expecting instances for records that existed before the metric definition was created, they will not be automatically generated.
     
     

    If I could help you with your Query then, please hit the Thumb Icon and mark as Correct !!

     

    Thanks, GP

View solution in original post

5 REPLIES 5

Hi @Prudhvi Raj Y ,

 

your custom table is extending Task table?

Please do below checks

If metric instances are not being created in ServiceNow after defining a metric, several factors could be missing or incorrectly configured:
 
  • Table Extension:
    Out-of-the-box ServiceNow metrics primarily function on tables that extend the Task table. If your request table does not extend Task, you may need to modify the "metrics events" Business Rule to include your specific table. This rule is responsible for triggering metric instance creation.
  • Metric Definition Configuration:
    • Field: Ensure the "Field" selected in your metric definition correctly points to the status field you are changing on the request.
    • Script: If you are using a script in your metric definition, verify its logic. Ensure it correctly identifies the conditions for metric instance creation and accurately captures the start and end values/timestamps.
    • Calculation Script: If you intend to calculate duration or other values, ensure the calculation script is correctly defined and the "Calculation Complete" field is being set to true when the metric instance should be considered complete.
  • "metric update events process" Scheduled Job:
    This job processes the events that lead to metric instance creation. If this job is not running or its "Next action" date is in the future, metric instances will not be generated. Verify the job's status and schedule.
  • Business Rule Configuration (for custom tables):
    If your request table is not a Task extended table, you may need to:
    • Locate the "metrics events" Business Rule (under Metrics > Business Rules).
    • Copy this Business Rule.
    • Change the "Table" field of the copied Business Rule to your specific request table.
    • Ensure the "When" and "Conditions" of this new Business Rule align with when you want metric instances to be created (e.g., after update, when status changes).
  • ACLs/Permissions:
    Ensure the user performing the status change has the necessary permissions to create records in the metric_instance table.
  • Existing Records:
    Metric instances are typically created upon record insertion or update, not for pre-existing records. If you are expecting instances for records that existed before the metric definition was created, they will not be automatically generated.
     
     

    If I could help you with your Query then, please hit the Thumb Icon and mark as Correct !!

     

    Thanks, GP