Getting Time Sheets

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

HTTP Method: GET

Description: Get time sheets.

Query Parameters:

Attribute Description
ownerUserId ID of the time sheet owner
periodId The time period ID

Response entity body:

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

    <ns2:timesheets xmlns:ns2="http://www.hp.com/ppm/tm/">
       <timeSheet>
         <id>446363</id>
         <periodId>30277</periodId>
         <resourceId>1</resourceId>
         <sequence>1</sequence>
         <status>1</status>
         <description>User, Admin - 11/5/12 - 11/11/12
         </description>
         <policies>
           <policy>
             <name>AllowMultipleTimeSheets</name>
             <value>false</value>
           </policy>
           <policy>
             <name>MaximumHoursPerDay</name>
             <value>false</value>
           </policy>
           <policy>
             <name>BucketShowLevel</name>
             <value>DAY</value>
           </policy>
           <policy>
              <name>BucketReportMethod</name>
              <value>HOUR</value>
           </policy>
           <policy>
              <name>HourInPeriodType</name>
              <value>Fixed</value>
           </policy>
           <policy>
              <name>ReqActivitiesRequiredFlag</name>
              <value>true</value>
           </policy>
         </policies>
         <notes>
           <note>
             <id>30180</id>
             <description>test11111</description>
             <type>TS</type>
             <createdBy>1</createdBy>
             <createdDate>2013-01-23T21:02:42.000-8:00
             </createdDate>
             <lastUpdatedBy>1</lastUpdatedBy>
             <lastUpdatedDate>2013-01-23T21:02:42.000-8:00
             </lastUpdatedDate>
           </note>
         </notes>
         <createdBy>1</createdBy>
         <lastUpdatedBy>1</lastUpdatedBy>
       </timeSheet>
       <timeSheet>
         <id>30222</id>
         <periodId>102463</periodId>
         <resourceId>1</resourceId>
         <sequence>1</sequence>
         <status>0</status>
         <description>User, Admin-11/5/12-11/11/12
         </description>
           </policy>
           <policy>
            <name>BucketShowLevel</name>
            <value>DAY</value>
           </policy>
           <policy>
            <name>BucketReportMethod</name>
            <value>HOUR</value>
           </policy>
           <policy>
            <name>HourInPeriodType</name>
            <value>Fixed</value>
           </policy>
           <policy>
             <name>ReqActivitiesRequiredFlag</name>
             <value>true</value>
           </policy>
         </policies>
         <createdBy>1</createdBy>
         <lastUpdatedBy>1</lastUpdatedBy>
       </timeSheet>
    </ns2:timesheets>
  • on failure: The following message codes are returned if the operation fails:

    Message Code

    HTTP Return Code

    Message

    Cause

    Possible Corrective Action

    PPM_WSE507

    400

    Error when trying to get time sheets. The operation to get time sheets is supported by two APIs: (1)get a time sheet by id (URL: itg/rest/tm/ timeSheets/id); (2) get time sheets by periodId and ownerUserId (URL: itg/ rest/tm/ timeSheets?periodId=1& ownerUserId=1).

    Query parameters are incorrect.

    Input correct query parameters.

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

    PPM_WSE007

    403

    The user does not have access to this resource.

    The user has no access to this resource.

    N/A