Specifying the .xml Files Based on the .xsd File
Review the timeConversion.xsd
file for the required formats of tags and data in the .xml
files. We recommend specifying one or two time sheets per .xml
file to perform tests and 50–100 time sheets per .xml
file to create the time sheets.
Table 12-1. Fields in .xml files used by the script shows the fields and descriptions for the required and optional fields. Each time sheet must include one set of time sheet data and one or more sets of time sheet line data. An example is provided in the following section.
Field (*Required) |
Description |
---|---|
Time Sheet Data |
|
*resourceUserName |
Username of the resource for whom the script will create a time sheet. This field becomes the Resource field in the time sheet. |
timesheetPolicy |
Name of the time sheet policy to apply to this resource. If not specified, the script uses the resource's current time sheet policy. |
*periodTypeCode |
One of the following period types (case-sensitive):
|
periodTypeStartDay |
Start day of the week(s) in the period. One of the following options (case-sensitive):
This field can be used with the
|
*periodStartDate |
Start date of the period. This field is required in conjunction with the |
timesheetSequence |
Sequence number of the time sheet. This field must be specified if there is more than one time sheet for the combination of resource and period. If not specified, the script assumes this is the only time sheet for the resource and period, and rejects other time sheets for the resource and period. This field becomes the Time Sheet # field in the time sheet. |
creationUser |
Username of the resource who created the time sheet. If not specified, the script uses the user specified as a script argument when the script is run. This field becomes the value in the User column in the Time Sheet Audit Trail window for the time sheet creation event. |
creationDate |
Timestamp for the creation of the time sheet. If not specified, the script uses the time when the script is run. The format must be as in the following example, although the script ignores the time of day: This field becomes the value in the Date column in the Time Sheet Audit Trail window for the time sheet creation event. |
lastUpdateUser |
Username of the resource who last updated the time sheet. If not specified, the script uses the user specified as a script argument when the script is run. |
lastUpdateDate |
Timestamp for the creation of the time sheet. If not specified, the script uses the time when the script is run. The format must be as in the following example, although the script ignores the time of day: |
timesheetNotes |
Plain text notes. This field is added to the Notes section in the time sheet. |
Time Sheet Line Data |
|
*workItemType |
Work item type. One of the following options (case-sensitive):
This field becomes part of the value in the Item column for the time sheet line. |
*workItemDescription |
Identifier for the work item in PPM, depending on its
If several tasks in a project have identical paths, only the first one in the project sequence is used.
This field becomes part of the value in the Item column for the time sheet line (for tasks, the full hierarchy does not appear). Note: For any miscellaneous work item, this field must be coded in the |
*timesheetLineStatus |
Time sheet line status. One of the following options (case-sensitive):
This field becomes the value in the Status column for the time sheet line. (The Status column is displayed only if the time sheet has been submitted.) |
approver |
Username of the resource who approved the time sheet line. If not specified, PPM determines the time sheet line approver when the script creates the time sheet. This field becomes the value in the User column in the Time Sheet Audit Trail window for the approval event. |
approvalDate |
Approval date of the time sheet line. (Ignored by the script if no If the If the This field becomes the value in the Date column in the Time Sheet Audit Trail window for the approval event. |
timesheetLineNotes |
Plain text notes. This field is added to the Notes tab in the Line Details for the time sheet line. |
Up to 20 user data fields: userData<number> visibleUserData<number> |
User data fields These fields are added to the User Data tab in the Line Details for the time sheet line. |
chargecode |
Tag for a set of charge codes to apply to the work item. Charge codes are optional, but if used, both the This data is added to the Charge Codes/Activities tab in the Line Details for the time sheet line. |
*chargecodeName |
Name of the charge code. Note: For each time sheet line, this field, if used, must be coded in the |
*chargecodePercent |
Percentage of the work item to assign to the charge code. Percentages for each work item must add up to exactly 100. |
*timeBreakdown |
Tag for the optional This data is added to the time sheet line. |
activityName |
Optional activity for the work item. In a time sheet, for time logged on any work item, you can specify one or more activities. However, if you specify an activity for some of the time logged on a work item, activities must be specified for all of the time logged on the work item. In the This data is added to the Charge Codes/Activities tab in the Line Details for the time sheet line. Note: For each time sheet line, this field, if used, must be coded in the |
periodValue Note: Either periodValue or the date and value for dateValueEntry must be specified. |
If the time sheet policy requires entry of time by period in units of hours, the total number of hours in the period to log for the work item on the time sheet. If the time sheet policy requires entry of time by period in units of days, the total number of days in the period to log for the work item on the time sheet. If the time sheet policy requires entry of time by period in percent, the percentage of the period to log for the work item on the time sheet. During the import process, the time sheet policy determines whether the script interprets the specified value as hours for the period, as days for the period, or as a percentage for the period. If the time sheet policy requires entry of time by day in units of hours or by day in units of days, the script ignores this value and uses the |
dateValueEntry Note: Either periodValue or the date and value for dateValueEntry must be specified. |
Tag for the entry of |
date |
Date for the hours or portion of a day logged. The format must be as in the following example, although the script ignores the time of day: If the time sheet policy requires entry of time by period in units of hours, by period in units of days, or by period in percent, the script ignores this value and uses the |
value |
Decimal number of hours or portion of a day logged for the If the time sheet policy requires entry of time by period in units of hours, by period in units of days, or by period in percent, the script ignores this value and uses the |
Note: Special characters in the .xml
file, as in notes or names, must be handled either as entity references or placed inside a CDATA
section with no breaks. The CDATA
section starts with <![CDATA[
and ends with ]].