Updated on 2023-06-12 GMT+08:00

Create work items.

Function

Create work items.

URI

POST /v4/projects/{project_id}/issue

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 a 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

actual_work_hours

No

Double

Indicates the actual person-hours.

assigned_id

No

Integer

Handler ID, which corresponds to the numeric ID of the user information.

begin_time

No

String

Start time, in the format of year-month-day.

description

No

String

Description

developer_id

No

Integer

Developer ID, which corresponds to the numeric ID of user information.

domain_id

No

Integer

ID domain, 14'Performance', 15'Function', 16'Reliability' 17'Cyber security' 18'Maintainability' 19'Other DFX' 20'Availability'

done_ratio

No

Integer

Work Item Progress Value

end_time

No

String

End time, in the format of year-month-day.

expected_work_hours

No

Double

Expected

iteration_id

No

Integer

Identifies a sprint.

module_id

No

Integer

Specifies the module ID.

name

Yes

String

Title

parent_issue_id

No

Integer

ID of the parent work item. This parameter is mandatory when a child work item is created. The value of tracker_id of the parent work item cannot be 2 or 3.

priority_id

Yes

Integer

Priority, 1: low, In 2, 3 high,

severity_id

No

Integer

Importance, 10 key, 11 important, 12 general, 13 Prompt,

status_id

No

Integer

Status ID, New 1, 2 in progress, 3 resolved, 4 in the test, 5 closed, 6 rejected,

tracker_id

Yes

Integer

Work item type. The options are as follows: 2: task; 3: defect /Bug,5Epic,6Feature,7Story. The value 5 can only be the parent work item type of 6. 6 can only be the parent work item type of 7. The value 7 can only be the parent of 2 or 3.

new_custom_fields

No

Array of NewCustomField objects

Custom Item

Table 4 NewCustomField

Parameter

Mandatory

Type

Description

custom_field

No

String

Custom Parameter

field_name

No

String

Custom field name

value

No

String

Value of a customized attribute. Use commas (,) to separate multiple values.

Response Parameters

Status code: 200

Table 5 Response body parameters

Parameter

Type

Description

actual_work_hours

Double

Indicates the actual person-hours.

assigned_cc_user

Array of IssueUser objects

Copy To

assigned_user

IssueUser object

  

begin_time

String

Start time, in the format of year-month-day.

creator

IssueUser object

  

custom_fields

Array of CustomField objects

Customized attribute value, which is not recommended. You are advised to refer to the new_custom_fields field.

new_custom_fields

Array of NewCustomField objects

Attribute Value

developer

IssueUser object

  

domain

domain object

ID domain, 14'Performance', 15'Function', 16'Reliability', 17'Cyber Security', 18'Maintainability', 19'Other DFX', 20'Availability',

done_ratio

Integer

Work Item Progress Value

end_time

String

End time, in the format of year-month-day.

expected_work_hours

Double

Expected

id

Integer

Work Item ID

project

IssueProjectResponseV4 object

Project Information

iteration

iteration object

Sprint

module

module object

Module

parent_issue

parent_issue object

Parent Work Item

priority

priority object

Work Item Priority

severity

severity object

Work Item Importance

status

status object

Work Item Statuses

tracker

tracker object

Work item type. The options are as follows: 2: task; 3: defect /Bug,5Epic,6Feature,7Story.

Table 6 IssueUser

Parameter

Type

Description

user_id

String

uuid

user_num_id

Integer

id

id

Integer

Specifies the user ID.

name

String

User Name

nick_name

String

Nickname

Table 7 CustomField

Parameter

Type

Description

name

String

Custom Attribute

value

String

Value of a customized attribute.

new_name

String

Custom Attribute

Table 8 NewCustomField

Parameter

Type

Description

custom_field

String

Custom Parameter

field_name

String

Custom field name

value

String

Value of a customized attribute. Use commas (,) to separate multiple values.

Table 9 domain

Parameter

Type

Description

id

Integer

Identifies a domain.

name

String

fields

Table 10 IssueProjectResponseV4

Parameter

Type

Description

project_id

String

Project ID

project_name

String

Project

project_num_id

Integer

Project ID

Table 11 iteration

Parameter

Type

Description

id

Integer

Identifies a sprint.

name

String

Iteration Name

Table 12 module

Parameter

Type

Description

id

Integer

Specifies the module ID.

name

String

Module

Table 13 parent_issue

Parameter

Type

Description

id

Integer

Parent Work Item ID

name

String

Parent Work Item

Table 14 priority

Parameter

Type

Description

id

Integer

Identifies a priority.

name

String

Priority

Table 15 severity

Parameter

Type

Description

id

Integer

Identifies a severity.

name

String

Indicates the level of severity.

Table 16 status

Parameter

Type

Description

id

Integer

Status ID.

name

String

Status Name

Table 17 tracker

Parameter

Type

Description

id

Integer

Type ID

name

String

Object

Status code: 400

Table 18 Response body parameters

Parameter

Type

Description

error_msg

String

Description

error_code

String

Error Codes

Status code: 401

Table 19 Response body parameters

Parameter

Type

Description

error_msg

String

Description

error_code

String

Error Codes

Example Requests

POST https://{endpoint}/v4/projects/526cefde62004de2b62b5e8dd2c2b3af/issue

{
  "parent_issue_id" : 1679822,
  "end_time" : "2018-07-05",
  "name" : "test",
  "begin_time" : "2018-1-31",
  "description" : "",
  "assigned_id" : 4091,
  "developer_id" : 4091,
  "tracker_id" : 3,
  "status_id" : 1,
  "priority_id" : 2,
  "severity_id" : 10,
  "iteration_id" : "11302238\r"
}

Example Responses

Status code: 200

OK

{
  "actual_work_hours" : 0,
  "assigned_cc_user" : [ {
    "id" : 4091,
    "name" : "user_name_demo",
    "nick_name" : "nick_name_demo"
  } ],
  "assigned_user" : {
    "id" : 4091,
    "name" : "user_name_demo",
    "nick_name" : "nick_name_demo"
  },
  "begin_time" : "2020-09-12",
  "creator" : {
    "id" : 4091,
    "name" : "user_name_demo",
    "nick_name" : "nick_name_demo"
  },
  "custom_fields" : [ {
    "name" : "customField16",
    "value" : "",
    "new_name" : "custom_field16"
  } ],
  "new_custom_fields" : [ {
    "custom_field" : "custom_field16",
    "field_name" : "field_name",
    "value" : "select1,select2"
  } ],
  "developer" : {
    "id" : 4091,
    "name" : "user_name_demo",
    "nick_name" : "nick_name_demo"
  },
  "domain" : {
    "id" : 14,
    "name" : ""
  },
  "done_ratio" : 0,
  "end_time" : "2020-09-19",
  "expected_work_hours" : 9,
  "id" : 4567,
  "project" : {
    "project_id" : "526cefde62004de2b62b5e8dd2c2b3af",
    "project_name" : "testDemo",
    "project_num_id" : 78953
  },
  "iteration" : {
    "id" : 456,
    "name" : "iteration_1"
  },
  "module" : {
    "id" : 456,
    "name" : "Project"
  },
  "parent_issue" : {
    "id" : 123,
    "name" : "paren_issue_demo"
  },
  "priority" : {
    "id" : 1,
    "name" : ""
  },
  "severity" : {
    "id" : 12,
    "name" : ""
  },
  "status" : {
    "id" : 1,
    "name" : ""
  },
  "tracker" : {
    "id" : 7,
    "name" : "story"
  }
}

Status Codes

Status Code

Description

200

OK

400

Bad Request

401

Unauthorized

Error Codes

See Error Codes.