Help Center/ CodeArts Req/ API Reference/ APIs/ Work Items of the Scrum Project/ Querying Labor Hours by User (Single Project)
Updated on 2023-06-12 GMT+08:00

Querying Labor Hours by User (Single Project)

Function

Querying Labor Hours by User (Single Project)

URI

POST /v4/projects/{project_id}/work-hours

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Specifies the 32-bit ID of the devcloud project.

Minimum: 32

Maximum: 32

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Specifies the user token. It can be obtained by calling an IAM API. The value of X-Subject-Token in the response header is the user token.

Minimum: 10

Maximum: 32768

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

user_ids

No

Array of strings

List of queried user IDs.

work_hours_types

No

String

Labor hour types separated by commas (,). 21: R&D design; 22: backend development; 23: frontend development (Web); 24: frontend development (applet); 25: frontend development (App); 26: test verification; 27: defect rectification; 28: UI design; 29: Meetings, 30: Public Affairs, 31: Training, 32: Research, 33: Others, 34: Replacement Leave

work_hours_dates

No

String

Labor hour date, separated by commas (,), in the format of year-month-day.

begin_time

No

String

Start date of working hours, in the format of year-month-day.

end_time

No

String

End date of working hours, in the format of year-month-day.

offset

Yes

Integer

Offset. offset is an integer multiple of limit. limit=10,offset=0,10,20...

Minimum: 0

Default: 0

limit

Yes

Integer

Number of records displayed on each page. A maximum of 100 records can be displayed on each page.

Minimum: 1

Maximum: 100

Default: 10

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

work_hours

Array of work_hours objects

Work Hour List

total

Integer

Total

Table 5 work_hours

Parameter

Type

Description

project_name

String

Project

nick_name

String

Nickname of the user.

user_id

String

User ID.

user_name

String

User Name

work_date

String

Labor Hour Date

work_hours_num

String

Labor Hour Cost

summary

String

Labor Hour Content

work_hours_type_name

String

Labor Hour Type

issue_id

Integer

Identifies a work item.

issue_type

String

Type

subject

String

Indicates the title of the work item.

created_time

String

Work Item Creation Time

closed_time

String

Work Item End Time

Status code: 400

Table 6 Response body parameters

Parameter

Type

Description

error_msg

String

Description

error_code

String

Error Codes

Status code: 401

Table 7 Response body parameters

Parameter

Type

Description

error_msg

String

Description

error_code

String

Error Codes

Example Requests

Post https://{endpoint}/v4/projects/e2da96a5d2c845e284f0ad47f8ca8cb2/work-hours

{
  "limit" : 1,
  "offset" : 0,
  "end_time" : "2020-08-14"
}

Example Responses

Status code: 200

ok

{
  "work_hours" : [ {
    "project_name" : "demo",
    "nick_name" : "demo",
    "user_id" : "09d75cdd9a00d44d2f17c01875483f26",
    "user_name" : "userName",
    "work_date" : "2020-02-19",
    "work_hours_num" : "2.0",
    "summary" : "summaryXXXXX",
    "work_hours_type_name" : "ddd",
    "issue_id" : 123456,
    "issue_type" : "Story",
    "subject" : "title",
    "created_time" : "2019-12-17",
    "closed_time" : "2019-12-20"
  } ],
  "total" : 1
}

Status Codes

Status Code

Description

200

ok

400

Bad Request

401

Unauthorized

Error Codes

See Error Codes.