
Noah Drew
ServiceNow Employee
Options
- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on 05-16-2025 05:51 AM
A Time Card has a reference to the Top Task (the main Project in the hierarchy) and the Task itself.
There is no direct correlation with a Sub Project.
If you were to add Time Cards to one of the descendent Project Tasks of the Sub Project, there would be no traditional Related List available since there is no related field to tie the relation back on the form.
With that being said, you do have the option for a Scripted Relationship (sys_relationship)
You can add a record on the above table and providing the following inputs:
Name: "Time Cards for Project level"
Applies to table: "Project [pm_project]"
Queries from table: "Time Card [time_card]"
Query with:
------------------------------------------------------------------------------------------------------------------
(function refineQuery(current, parent) {
var sysIds = parent.sys_id;
if(parent.instanceOf("pm_project")) {
var plannedTask = new GlideRecord('planned_task');
plannedTask.get(parent.getValue('sys_id'));
var plannedTaskApi = new SNC.PlannedTaskAPI();
var descendants = plannedTaskApi.getDescendants(plannedTask, false);
while (descendants.next()) {
sysIds += ", " + descendants.sys_id;
}
}
current.addQuery('task', 'IN', sysIds);
})(current, parent);
------------------------------------------------------------------------------------------------------------------
You can then add this as a Related List on the pm_project form.
It should be near the bottom with the name you gave it (Time Cards for Project level) and past the original alphabetical sort of "T"
Note that being a scripted Related List may cause a slower form load if the Project hierarchy is large.
Hope this helps someone!
Comments

Namita Mishra
ServiceNow Employee
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
05-17-2025
02:16 AM
Hi @Noah Drew ,
Hope you are doing well and Thanks for sharing the post.
In SPM, the task of the sub project has a timesheet related list which shows the timecards of that specific task.
At the same time, the end user can also post the time for the sub project as well as the task of the sub project.
Thank You!
Namita Mishra