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.
URI
POST /v2/project/templates
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
Yes |
String |
Definition: User token. Obtain the token by calling theObtaining a User TokenIAM API. In the returned response header, X-Subject-Token is the desired user token. Constraints: Mandatory. Range: Minimum length: 10 character. Maximum length: 32,768 characters. Default value: N/A |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
projectUUId |
Yes |
String |
Definition: 32-character UUID of a project, which uniquely identifies a project. Obtain the value of this parameter from the project_id field in the response body of the Querying the Project List API. Constraints: Regular expression: [A-Za-z0-9]{32} Options: 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 Options: 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: Regular expression: [\s\S]{1,1000} Options: N/A Default value: N/A |
position |
No |
Integer |
Definition: Field priority. Constraints: Regular expression: [0-9]{1,10} Options: N/A Default value: N/A |
Response Parameters
Status code: 200
The API is successfully responded.
None
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
The API is successfully responded.
{ "result" : { }, "status" : "success" }
Status Codes
Status Code |
Description |
---|---|
200 |
The API is successfully responded. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank 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