Creating or Updating a Work Item Template
Function
This API is used to create or update a work item template.
Calling Method
For details, see Calling APIs.
Authorization Information
No identity policy-based permission required for calling this API.
URI
POST /v2/project/templates
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| X-Auth-Token | Yes | String | Definition User token. Obtain a token by calling the IAM API for obtaining a user token. The value of X-Subject-Token in the response header is the user token. Constraints N/A Range The value contains 10 to 32,768 characters. Default Value N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| projectUUID | Yes | String | Definition A 32-character UUID. It uniquely identifies a project. Obtain a project ID by calling the API for querying projects. The value of project_id in the response message body is a project ID. Constraints A string of 32 characters consisting of letters and digits. Range N/A Default Value N/A |
| description | No | String | Definition: Description of a work item template. Constraints: Minimum length: 0 characters. Maximum length: 65,535 characters. Options: N/A Default value: N/A |
| trackerId | Yes | Integer | Definition Work item type ID. Constraints N/A Range 2 (task) 3 (bug) 5 (epic) 6 (feature) 7 (story) Default Value N/A |
| issueFieldConfigs | No | Array of IssueFieldConfig objects | Definition: Field configuration information. Constraints: N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| field | No | String | Definition: Field name. Constraints: Only uppercase letters, lowercase letters, digits, underscores (_), and hyphens (-) are allowed. Options: N/A Default value: N/A |
| is_required | No | Integer | Definition: Whether a field is mandatory. Constraints: N/A Options: 0: optional 1: mandatory Default value: N/A |
| default_value | No | String | Definition Default value of a field. Constraints 1 to 1,000 characters. Range N/A Default Value N/A |
| position | No | Integer | Definition Field priority. Constraints A numeric string of 1 to 10 characters. Range N/A Default Value N/A |
Response Parameters
Status code: 200
None
Status code: 400
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Definition Error code. Range N/A |
| error_msg | String | Definition Error description, which is a supplement to error_code. Range N/A |
Example Requests
POST https://{endpoint}/v2/project/templates
{
"description" : "<p style=\"padding-top: 5.0px;\"><span style=\"font-weight: bold;\"> As </span><User role></p><p><br></p><p style=\"padding-top: 5.0px;\"><span style=\"font-weight: bold;\"> I want </span><to do something></p><p><br></p><p style=\"padding-top: 5.0px;\"><span style=\"font-weight: bold;\"> so as to </span><do something> </p>",
"projectUUID" : "816e5f0877544de58010157fc30da3e7",
"trackerId" : "7",
"issueFieldConfigs" : [ {
"field" : "status_id",
"is_required" : 2,
"default_value" : "New",
"position" : 1
}, {
"field" : "assigned_to_id",
"is_required" : 2,
"default_value" : "Myself",
"position" : 2
}, {
"field" : "module_id",
"is_required" : 1,
"default_value" : "",
"position" : 3,
"is_visible" : true
}, {
"field" : "fixed_version_id",
"is_required" : 0,
"default_value" : "",
"position" : 4
}, {
"field" : "start_date",
"is_required" : 0,
"default_value" : "",
"position" : 5
}, {
"field" : "due_date",
"is_required" : 0,
"default_value" : "",
"position" : 6
}, {
"field" : "order",
"is_required" : 0,
"default_value" : "1",
"position" : 7
}, {
"field" : "priority_id",
"is_required" : 2,
"default_value" : "Medium",
"position" : 8
}, {
"field" : "severity_id",
"is_required" : 2,
"default_value" : "Minor",
"position" : 9
}, {
"field" : "assigned_cc",
"is_required" : 0,
"default_value" : "",
"position" : 10
}, {
"field" : "parent_issue_id",
"is_required" : 0,
"default_value" : "",
"position" : 11
}, {
"field" : "domain_id",
"is_required" : 0,
"default_value" : "",
"position" : 12
}, {
"field" : "more",
"is_required" : 0,
"default_value" : "",
"position" : 13
}, {
"field" : "releaseDev",
"is_required" : 0,
"default_value" : "",
"position" : 14
}, {
"field" : "developer",
"is_required" : 0,
"default_value" : "",
"position" : 15
}, {
"field" : "expected_work_hours",
"is_required" : 0,
"default_value" : "0",
"position" : 16
}, {
"field" : "actual_work_hours",
"is_required" : 0,
"default_value" : "",
"position" : 17
}, {
"field" : "done_ratio",
"is_required" : 0,
"default_value" : "",
"position" : 18
}, {
"field" : "story_point_id",
"is_required" : 0,
"default_value" : "1",
"position" : 19
}, {
"field" : "custom_field18",
"is_required" : 0,
"default_value" : "",
"position" : 20
} ]
} Example Responses
Status code: 200
{
"result" : { },
"status" : "success"
} Status code: 400
{
"error_code" : "PM.02100011",
"error_msg" : "No access permission."
} Status Codes
| Status Code | Description |
|---|---|
| 200 | The API is successfully responded. |
| 400 | Error response indicating no permission. |
Error Codes
See Error Codes.
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot