Time cards are visible when resource status is still pending - SPM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi all,
I have a question regarding the SPM Time Card and Resource Assignment process.
Currently, when a Resource Manager assigns a task to a resource, that task becomes immediately visible in the resource’s Time Sheet Portal, even if the Resource Status is still Pending (i.e., not yet Approved or Rejected).
Is there a way to configure the Time Sheet Portal so that only tasks with Approved resource assignments are visible to the resource?
Thanks!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi Gaspar,
Short and honest answer
Out-of-the-box, ServiceNow does NOT provide a configuration switch to hide tasks from the Time Sheet Portal until the resource assignment is Approved.
What you’re seeing is expected OOTB behavior.
However, i also wonder what would be your used case, the OOTB covers a lot of best practices and process dependencies, hence just in case if you are unable to convince the process owner, you have below 2 workarounds in my experience, which first need to be tested in lower environment before execution on the production as without proper impact analysis this could cause other flows to break. *caution only a workaround
Option 1: Portal widget filter (Most common & clean)
Modify the Time Sheet Portal widget query to only include:
Resource Assignments where state = approved
Option 2: ACL-based restriction (Not recommended)
Use ACLs to restrict access to:
Planned Tasks
Based on assignment state
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @Navid Thakur , thanks for your reply.
1 - For option 1 , I think the widget to modify is timecard-task-selector . Unfortunatelly, I wasn't able to make it work yet. Is there any help you can give me on that server script when gets the cards to show ?
2 - For option 2 , can you be more specific please ?
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Option 1 (i will still recommend option 1 as this is more safe and probably in future someone could request to see all status)-
Clone the Time Sheet Portal widget
Update the server-side query logic to: resource_assignment.state = approved
Option2 -
| Planned task | planned_task |
| Resource assignment | resource_assignment |
| Time entry pulls tasks via | Planned task + assignment |
The Time Sheet Portal queries planned tasks, not assignments directly.
Then once you identify the users
You restrict read access to planned_task for non-admin users, based on:
Logged-in user
Their resource assignment
Assignment approval state
Step 1 for option 2: Create a READ ACL on planned_task
Table: planned_task
Operation: read
Type: record
ACL Conditions (leave empty)
Do not add conditions here — we’ll do everything in the script.
Below is just an example server side script, you can even use chatgpt to be very specific based on your SPM Table structure, ACL governance, user details and scenario (the same i have attached too as a file, please perform all this in your dev environment before production, do not apply this directly on prod)
(function () {
// Allow admins and resource managers
if (gs.hasRole('admin') || gs.hasRole('resource_manager')) {
return true;
}
var userId = gs.getUserID();
var taskId = current.sys_id;
// Find resource assignment for this user + planned task
var ra = new GlideRecord('resource_assignment');
ra.addQuery('task', taskId);
ra.addQuery('user', userId);
ra.query();
if (!ra.next()) {
// User has no assignment → deny visibility
return false;
}
// Allow only if assignment is Approved
if (ra.state == 'approved') {
return true;
}
// Pending / Requested / Rejected → hide task
return false;
})();

