---
sourceDocument: Zurich Strategic Portfolio Management
sourceDocumentLink: https://www.servicenow.com/docs/r/zurich/it-business-management

 Release :

    - zurich

ft:locale :

    - en-US

ft:publication_title :

    - Zurich Strategic Portfolio Management

ft:clusterId :

    - itbm

bundleId :

    - itbm

workflow :

    - Technology


---

# Auto-generate time cards

# Auto-generate time cards {#ariaid-title1}

* Release version: Zurich
* 
* Updated July 31, 2025
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 minute to read

As an admin, you can configure a scheduled job to generate time cards automatically
for project tasks assigned to time card users.

## Before you begin

Role required: admin

## About this task

In addition to the manual option Generate Time Cards, a scheduled job can be run to automatically generate the time cards for project tasks. A job can be scheduled to run every week, for example, on every Sunday to generate time sheets for all users for the next week. You can configure when to run the scheduled job based on the business process of the organization. By default, the scheduled job is turned off. For more information, see [Schedule a script
execution](https://www.servicenow.com/docs/access?context=t_ScheduleAScriptExecution&version=zurich&pubname=zurich-platform-administration&ft:locale=en-US) .  
Note:  
The scheduled job auto-generates time cards only for those users who have the Auto create time cards every week option set to true in their assigned [time sheet policy](https://www.servicenow.com/docs/nA9QWFKBcPgQt8MbGZ0Qaw#create-time-sheet-policy__time_sheet_policy_form).

## Procedure

1. Navigate to AllSystem DefinitionScheduled Jobs.
2. In the Scheduled Jobs list, select Auto Generate Time Cards.
3. Configure the following parameters in the script as per the business requirements:  
   * run for (CURRENT_WEEK, NEXT_WEEK, LAST_WEEK)
   * Group Name (includeGroups, excludeGroups)

   {#auto-generate-time-cards__ul_t31_mdt_qx}  
   Note:  
   * If a time card exists for a project task for the time card week, a duplicate time card is not created.
   * Time cards are generated only for those project tasks that are in progress or planned in that week.
   * The Allow time card reporting on field on the [project
     form](https://www.servicenow.com/docs/QVIkzZVvZEk9OVtjD2zWOw "Initiate a project by changing the project state to Work in Progress. Define important aspects of your Agile, Waterfall, or Hybrid project such as the duration, estimated cost, and net value to your organization to efficiently track the project's progress.") determines the level that the time cards for the project tasks are created at.
   {#auto-generate-time-cards__ul_fwz_w3l_qx}

## Example

The following example script is executed when a scheduled job is run to generate time
cards for the <kbd class="ph userinput">Current week</kbd> for the
<kbd class="ph userinput">Database</kbd> and <kbd class="ph userinput">Hardware</kbd> groups:

    // Clone this schedule job to run separately for different groups at different times
    // One of the following values
    // TimeCardConstants.CURRENT_WEEK
    // TimeCardConstants.NEXT_WEEK
    // TimeCardConstants.LAST_WEEK
    var runFor = TimeCardConstants.CURRENT_WEEK;

    // Comma separated group sys ids or group names. TimeSheet/TimeCards will be auto generated for time card users in the given groups.
    var includeGroups = [Database,Hardware];
    var excludeGroups = [];

    var generator = new TimeCardGenerator();
    generator.generateFromConfig(runFor, includeGroups, excludeGroups);

*[\>]: and then


