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.

Table 12-1. Fields in .xml files used by the script

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):

  • WEEKLY

  • BI_WEEKLY

  • SEMI_MONTHLY

  • MONTHLY

periodTypeStartDay

Start day of the week(s) in the period. One of the following options (case-sensitive):

  • SUNDAY

  • MONDAY

  • TUESDAY

  • WEDNESDAY

  • THURSDAY

  • FRIDAY

  • SATURDAY

This field can be used with the periodTypeCode field (but only if it is WEEKLY or BI_WEEKLY) to identify the PERIOD_TYPE_ID that the script will use from the ktmg_period_types database table, as follows:

  • If this field is specified, the script will use the database table PERIOD_TYPE_ID that specifies the same PERIOD_TYPE_START_DAY.

  • If this field is not specified, the script will use the database table PERIOD_TYPE_ID for which no PERIOD_TYPE_START_DAY is specified.

*periodStartDate

Start date of the period. This field is required in conjunction with the PERIOD_TYPE_ID (determined from the required periodTypeCode field and the optional periodTypeStartDay field) to identify a specific period for the time sheet. The format must be as in the following example, although the script ignores the time of day:

2009-06-14T13:00:00Z

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:

2009-06-15T13:00:00Z

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:

2009-06-15T13:00:00Z

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):

  • PROJECT

  • TASK

  • REQUEST

  • PACKAGE

  • MISC

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 workItemType, as follows:

  • For projects, the project name.

  • For tasks, the full hierarchical path, from the project name to the specific task name, concatenated into one string and delimited by the PPM separator #@#, as in the following:

    Project XYZ#@#First Task#@#Subtask A

    If several tasks in a project have identical paths, only the first one in the project sequence is used.

  • For requests, the Request # field.

  • For packages, the Package # field.

  • For miscellaneous items, any selection from the TMG - Misc. Work Items validation.

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 .xml file in the language that will be specified for the -languageCode field when the script is run, otherwise the script will not find the miscellaneous work item. For more information, see Running the Time Sheet Data Importer Script.

*timesheetLineStatus

Time sheet line status. One of the following options (case-sensitive):

  • UNSUBMITTED

  • SUBMITTED

  • APPROVED

  • REJECTED

  • CANCELLED

  • FROZEN

  • CLOSED

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 approver is specified.) The format must be as in the following example, although the script ignores the time of day:

2009-06-15T13:00:00Z

If the approver field is specified but the approvalDate field is not, the script uses the approver field and the current date when it creates the time sheet line.

If the approvalDate field is specified but the approver field is not, the script ignores both fields.

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 userData1 and visibleUserData1 through userData20 and visibleUserData20. User data fields are optional but, if used, both tags must be specified for each user data field, and they must have values that are established in PPM (the script does not verify the values). See the user data fields in the               TM_TIME_SHEET_LINES database table.

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 chargecodeName field and the chargecodePercent field described in the following rows must be specified for each charge code.

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 .xml file in the language that will be specified for the -languageCode field when the script is run, otherwise the script will not find the charge code. For more information, see Running the Time Sheet Data Importer Script.

*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 activityName field and the required periodValue field or dateValueEntry (date and value) field for time logged.

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 .xml file, within one set of timeBreakdown tags, you can specify only one activityName field. Use multiple timeBreakdown tags for a time sheet line only if you need to specify multiple activities for the line.

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 .xml file in the language that will be specified for the -languageCode field when the script is run, otherwise the script will not find the activity. For more information, see Running the Time Sheet Data Importer Script.

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 date and value fields for the dateValueEntry tag instead.

dateValueEntry

Note: Either periodValue or the date and value for dateValueEntry must be specified.

Tag for the entry of date and value fields instead of the periodValue field.

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:

2009-06-15T13:00:00Z

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 periodValue field instead.

value

Decimal number of hours or portion of a day logged for the date.

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 periodValue field instead.

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 ]].