How to use CMDB Data Management Task Policy Execution ID?

jimmillet
Mega Guru

We are using CMDB Workspace method to create CMDB Certification Tasks. So we created the Certification Policy and we are thinking of scheduling on a periodic basis. So here's my question: How can I can I create a report filter that only looks at the tasks created by the current run of the policy? I have a dashboard that slices up the certification tasks in a few ways, but I don't want the old tasks from previous runs of the policy to be included.

In the legacy data certification solution, there was a field called "certification instance" that could be used. I do see a field in the current method called "Policy Execution ID" that looks like it could be used to separate out the tasks for the current policy run, but the value in that field does not contain the "number" of the policy ID. I see two values for Policy Execution ID field in the cmdb_data_management_task table: "Completed" and "(empty)". When I go to cmdb_data_management_policy_execution table, I see a "Number" field that has an identifier (PLCEXEC0000001019), but I can't see that string value referenced anywhere in the cmdb_data_management_task table. When I mouse over the "Completed" I see a URL that has a sys_id to a cmdb_data_management_policy_execution entry, but not sure why the value shown is "Completed". I have attached a screen shot that shows the "Policy Execution ID" column.

2 REPLIES 2

jimmillet
Mega Guru

Update: We opened a case with ServiceNow to address the value in the "Policy Execution ID" field, so now the "Number" is populated in the "Policy Execution ID" field in the task. But I am still struggling how to identify the "correct" "Policy Execution ID". Do I need to create a database view that joins the cmdb_data_management_policy_execution and cmdb_data_management_task table (join on "Policy Execution ID"?)

Hi @jimmillet ,

 

As per my understanding, this will be helpful for you.

 

. Understanding the Data Model
* cmdb_data_management_task → holds each certification task.
* Policy → Reference to the cmdb_data_management_policy record.
* Policy Execution ID → Reference to the cmdb_data_management_policy_execution record.
* cmdb_data_management_policy_execution → one record per execution of a certification policy.
* Number (e.g., PLCEXEC0000001019) → unique execution run identifier.
* State → e.g., Completed, In Progress.
* Policy → Reference to the policy that was executed.


When SN fixed your case so the Policy Execution ID field now stores the Number, you can filter by it.

 

2. How to Filter for the Current Run
To show only tasks from the latest execution of a policy:


1. Find the latest Policy Execution ID for your policy
* Go to cmdb_data_management_policy_execution list.
* Filter: policy = <your policy> → Sort by Created or Number DESC → Take the first record’s Number.


2. Use that ID in your dashboard/report filter
* On the cmdb_data_management_task table report:
Policy Execution ID = PLCEXEC0000001019
* This will show only tasks from that execution.

 

3. Automating “latest run” without manual updates
If you don’t want to hardcode the latest execution number:


* Option A – Database View
1. Create a DB View joining:
* cmdb_data_management_task.policy_execution_id (sys_id) → cmdb_data_management_policy_execution.sys_id
2. Pull Number from the execution table into the view.
3. In your report, filter:
Number = (MAX number for the policy)

 

* Option B – Dynamic Filter Option
1. Create a Dynamic Filter (System Definition → Dynamic Filter Options).
2. Script: Query cmdb_data_management_policy_execution for the latest run of a given policy.
Return its sys_id.
3. Use this dynamic filter in the dashboard.

 

* Option C – Scripted Report Source
* Create a scripted data source that queries only the latest execution tasks.
* Useful if you want to run it for multiple policies.

 

4. Why “Completed” showed before
Originally, Policy Execution ID displayed the state label instead of the Number because the field was referencing the execution record but the display value was set to state.
ServiceNow’s fix updated it to display Number instead — now you can filter by it just like in the legacy Certification Instance model.

 

Please appreciate the efforts of community contributors by marking appropriate response as Mark my Answer Helpful or Accept Solution this may help other community users to follow correct solution in future.
 

Thank You
AJ - TechTrek with AJ - ITOM Trainer
LinkedIn:- https://www.linkedin.com/in/ajay-kumar-66a91385/
YouTube:- https://www.youtube.com/@learnitomwithaj
Topmate:- https://topmate.io/aj_techtrekwithaj (Connect for 1-1 Session)
ServiceNow Community MVP 2025