Auto-generate time cards
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
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.
Procedure
Example
The following example script is executed when a scheduled job is run to generate time cards for the Current week for the Database and Hardware 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);