Updating a Time Sheet

Request: http://<PPM_Server_IP>:<port>/itg/rest/tm/timeSheets/{timeSheetId}

HTTP Method: PUT

Description: Update a time sheet.

Request path variables:

Attribute Description
timesheetId The id of the time sheet

Request entity body: The body of this operation needs t include an XML object with the following format:

 <TimeSheet>
    <id>447943</id> 
    <periodId>100099</periodId> 
    <resourceId>1</resourceId> 
    <sequence>1</sequence> 
    <status>1</status> 
    <description>User, Admin - 13-5-1 - 13-5-15</description> 
    <notes>
      <note>
        <id>159842</id> 
        <description>updated time sheet note</description> 
        <type>TS</type> 
      </note>
      <note>
        <id>159842</id> 
        <description>add time sheet note</description> 
        <type>TS</type> 
      </note>
    </notes>
    <timeSheetLines>
      <id>1467788</id> 
      <workItemId>3282935</workItemId> 
      <workItemType>PROJECT</workItemType> 
      <actuals>
        <actual>
          <activityId>30067</activityId> 
          <efforts>
            <dayNum>10</dayNum> 
            <effort>20.0</effort> 
          </efforts>
          <efforts>
            <dayNum>15</dayNum> 
            <effort>6.0</effort> 
          </efforts>
          <activityType>added</activityType> 
        </actual>
        <actual>
          <activityId>30076</activityId> 
          <efforts>
            <dayNum>7</dayNum> 
            <effort>10.0</effort> 
          </efforts>
          <activityType>added</activityType> 
        </actual>
        <actual>
          <activityId>30131</activityId> 
          <activityType>added</activityType> 
        </actual>
        <actualsType>activity</actualsType> 
      </actuals>
      <workUnit>
        <id>171904</id> 
        <percentComplete>50.0</percentComplete> 
      </workUnit>
      <chargeCodes>
        <updateChargeCodeFlag>true</updateChargeCodeFlag> 
        <requireChargeCodeFlag>false</requireChargeCodeFlag> 
        <tslChargeCodes>
          <chargePercent>0.0</chargePercent> 
          <chargeCode>
            <id>100002</id> 
          </chargeCode>
        </tslChargeCodes>
        <tslChargeCodes>
          <chargePercent>90.0</chargePercent> 
          <chargeCode>
            <id>100003</id> 
          </chargeCode>
        </tslChargeCodes>
      </chargeCodes>
      <workItemSetId>60000</workItemSetId> 
      <notes>
        <note>
          <id>159841</id> 
          <description>updated tsl notes</description> 
          <type>TSL</type> 
      </note>
        <note>
          <id>159841</id> 
          <description>add tsl notes</description> 
          <type>TSL</type> 
        </note>
      </notes>
    </timeSheetLines>
    <timeSheetLines>
        <id>1467791</id> 
        <workItemId>217037</workItemId> 
        <workItemType>TASK</workItemType> 
        <status>1</status> 
        <actuals>
          <actual>
            <efforts>
              <dayNum>7</dayNum> 
              <effort>9.0</effort> 
            </efforts>
            <efforts>
              <dayNum>10</dayNum> 
              <effort>7.0</effort> 
            </efforts>
            <efforts>
              <dayNum>15</dayNum> 
              <effort>8.0</effort> 
            </efforts>
          </actual>
          <actualsType>common</actualsType> 
        </actuals>
        <workUnit>
          <percentComplete>60</percentComplete> 
        </workUnit>
        <chargeCodes>
          <updateChargeCodeFlag>true</updateChargeCodeFlag> 
          <requireChargeCodeFlag>false</requireChargeCodeFlag> 
          <tslChargeCodes>
            <chargePercent>80.0</chargePercent> 
            <chargeCode>
              <id>100002</id> 
            </chargeCode>
          </tslChargeCodes>
          <tslChargeCodes>
            <chargePercent>20.0</chargePercent> 
            <chargeCode>
              <id>100001</id> 
            </chargeCode>
          </tslChargeCodes>
        </chargeCodes>
        <workItemSetId>31600</workItemSetId> 
        <notes /> 
      </timeSheetLines>
    </TimeSheet>

Response entity body:

  • on success: Return an XML object of the updated time sheet with the following format:

    <ns2:updateTimeSheetResponse>
       <timeSheetId>30291</timeSheetId>
       <timeSheetLineIds>30527</timeSheetLineIds>
    </ns2:updateTimeSheetResponse>
  • on failure: The following message codes are returned if the operation fails:

    Message Code

    HTTP Return Code

    Message

    Cause

    Possible Corrective Action

    PPMC_WSE006

    403

    The user does not have the access grant to perform this action.

    The user does not have the required access grant.

    Get the access grant.

    PPMC_WSE007

    403

    The user does not have access to this resource.

    The user has no access to this resource.

    N/A

    PPMC_WSE513

    400

    Field {0} cannot be null or empty.

    Field {0} is empty.

    Fill the field with a value.

    PPMC_WSE514

    400

    Field {0} should be greater than {1}.

    Field {0} is less than {1}.

    Correct the field value.

    PPMC_WSE515

    400

    Field {0} should be greater than or equal to {1}.

    Field {0} is less than {1}.

    Correct the field value.

    PPMC_WSE516

    400

    Field {0} should be less than {1}.

    Field {0} is not less than {1}

    Correct the field value.

    PPMC_WSE517

    400

    Field {0} should be less than or equal to {1}.

    Field {0} is greater than {1}.

    Correct the field value.

    PPMC_WSE518

    400

    Field {0} should be greater than {1} and less than {2}.

    Field {0} is not greater than {1} and less than {2}

    Correct the field value.

    PPMC_WSE519

    400

    Field {0} should be greater than or equal to {1} and less than or equal to {2}.

    Field {0} is not greater than or equal to {1} and less than or equal to {2}.

    Correct the field value.

    PPMC_WSE520

    400

    The status can only be UNSUBMITTED when a time sheet is created.

    The status is not UNSUBMITTED when a time sheet is created.

    Correct the field value.

    PPMC_WSE521

    400

    Fail to pass business restriction.

    Fail to pass business restriction.

    N/A

    PPMC_WSE522

    500

    Time Management service internal error.

    There was an internal error when you executed this operation.

    N/A

    PPMC_WSE523

    400

    Total actual effort cannot be less than 0.

    Total actual effort is less than 0.

    Correct the total actual effort.

    PPMC_WSE524

    400

    The day number exceeds the time period duration, and the day number {0} cannot be greater than {1}.

    The day number exceeds the time period duration, and the day number {0} is greater than {1}.

    Correct the day number.

    PPMC_WSE525

    400

    Work item type must be one of the following types [TASK, PROJECT, REQUEST, PACKAGE, MISC].

    Work item type is undefined.

    Choose the work item type from the [TASK, PROJECT, REQUEST, PACKAGE, MISC] list.

    PPMC_WSE526

    400

    The work item [{0}:{1}] is invalid for resource {2} and time period {3}.

    The work item [{0}:{1}] is invalid for resource {2} and time period {3}.

    Choose a valid work item for resource {2} and time period {3}.