Creating a Service Ticket
Function
This API is used to create a change ticket or issue ticket. The type of the service ticket to be created is determined by the path parameter ticket_type. If the value of ticket_type is change, a change ticket is created. If the value of ticket_type is issues_mgmt, an issue ticket is created.
Authorization Information
Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.
- If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
- If you are using identity policy-based authorization, the following identity policy-based permissions are required.
Action
Access Level
Resource Type (*: required)
Condition Key
Alias
Dependencies
coc:ticket:create
Write
-
-
-
-
URI
POST /v1/{ticket_type}/tickets
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
ticket_type |
Yes |
String |
Definition: Type of the service ticket to be created. The value is change for a change ticket and issues_mgmt for an issue ticket. Constraints: N/A Value range: The value can be:
Default value: N/A |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
title |
No |
String |
Definition: Service ticket title. Constraints: N/A Value range: N/A Default value: N/A |
|
change_notes |
No |
String |
Definition: Change ticket description. Constraints: This parameter is mandatory when ticket_type is set to change to create a change ticket. Value range: N/A Default value: N/A |
|
description |
No |
String |
Definition: Issue ticket description. Constraints: This parameter is mandatory when ticket_type is set to issues_mgmt to create an issue ticket. Value range: N/A Default value: N/A |
|
enterprise_project |
No |
String |
Definition: Enterprise project ID. If the enterprise project is default, the value of this parameter is 0. You can obtain the enterprise project list through EPS. Constraints: This parameter is mandatory when ticket_type is set to issues_mgmt to create an issue ticket. Value range: N/A Default value: 0 |
|
change_type |
No |
String |
Definition: Change type. The options are change_type_conventional and change_type_urgentu. Constraints: This parameter is mandatory when ticket_type is set to change to create a change ticket. Value range: Enumerated value
Default value: N/A |
|
level |
No |
String |
Definition: Ticket level. Constraints: N/A Value range: Enumerated values when ticket_type is set to change to create a change ticket change_level_010: level-A change change_level_020: level-B change change_level_030: level-C change change_level_040: level-D change Enumerated values when ticket_type is set to issues_mgmt to create an issue ticket issues_level_1000: critical issues_level_2000: major issues_level_3000: minor issues_level_4000: warning Default value: N/A |
|
ticket_type |
No |
String |
Definition: Type of the issue ticket. You can query all types of problems that can be transferred on the COC > Basic Configuration > Process Management > Issue Process > Issue Type page. The issue type ID is set for this scenario. Constraints: This parameter is mandatory when ticket_type is set to issues_mgmt to create an issue ticket. Value range: N/A Default value: N/A |
|
change_scheme |
No |
String |
Definition: Task type. The options are job and change guide. Constraints:
Value range: Enumerated value change_scheme_runbook: job change_scheme_guides: change guide Default value: N/A |
|
change_guides |
No |
String |
Definition: Change guide ID. Constraints: This parameter is mandatory when ticket_type is set to change to create a change ticket and the change guide is selected for the task. Value range: N/A Default value: N/A |
|
commit_upload_attachment |
No |
String |
Definition: Issue ticket attachment ID. Constraints: This parameter is optional when ticket_type is set to issues_mgmt to create an issue ticket. Value range: N/A Default value: N/A |
|
regions |
No |
String |
Definition: Region to which the issue ticket belongs. Enter region IDs and separate them with commas (,). Constraints: This parameter is optional when ticket_type is set to issues_mgmt to create an issue ticket. Value range: N/A Default value: N/A |
|
change_scene_id |
No |
String |
Definition: Change scenario. Constraints: This parameter is mandatory when ticket_type is set to change to create a change ticket. Value range: The value can be obtained from the Attribute ID column of the list on the Process Management > Change Scenario page. Example: GOCMLL06 Default value: N/A |
|
current_cloud_service_id |
No |
String |
Definition: Change service ID, which can be obtained through the application query interface. Constraints: This parameter is mandatory when ticket_type is set to change to create a change ticket. Value range: N/A Default value: N/A |
|
root_cause_cloud_service |
No |
String |
Definition: ID of the root cause service of the issue ticket. You can obtain the value by calling the application query API. Constraints: This parameter is optional when ticket_type is set to issues_mgmt to create an issue ticket. Value range: N/A Default value: N/A |
|
source |
No |
String |
Definition: Source of the issue ticket. Constraints: This parameter is optional when ticket_type is set to issues_mgmt to create an issue ticket. Value range: If ticket_type is set to issues_mgmt, the following enumerated values are supported: issues_mgmt_associated_type_1000: event issues_mgmt_associated_type_4000: proactive O&M discovery issues_mgmt_associated_type_2000: alarm issues_mgmt_associated_type_3000: war room Default value: N/A |
|
source_id |
No |
String |
Definition: Ticket number of the source of the issue ticket. Constraints:
Value range: N/A Default value: N/A |
|
fount_time |
No |
Long |
Definition: Discovery time, which is a timestamp. Constraints: This parameter is optional when ticket_type is set to issues_mgmt to create an issue ticket. Value range: N/A Default value: N/A |
|
virtual_schedule_type |
No |
String |
Definition: Type of the issue ticket handler. Constraints: This parameter is mandatory when ticket_type is set to issues_mgmt to create an issue ticket. Value range: Enumerated value
Default value: N/A |
|
issue_contact_person |
No |
String |
Definition: ID of the owner of a issue ticket. Constraints: This parameter is optional when ticket_type is set to issues_mgmt to create an issue ticket. If the owner of a issue ticket needs to be specified, this parameter is mandatory. Value range: N/A Default value: N/A |
|
schedule_scenes |
No |
String |
Definition: Owner of the issue ticket, which is obtained from the shift. The value is the shift scenario ID. Constraints: This parameter is optional when ticket_type is set to issues_mgmt to create an issue ticket. Value range: N/A Default value: N/A |
|
virtual_schedule_role |
No |
String |
Definition: The owner of the issue ticket is obtained from the shift. The value is the shift role ID. Constraints: This parameter is optional when ticket_type is set to issues_mgmt to create an issue ticket. Value range: N/A Default value: N/A |
|
location_id |
No |
String |
Definition: Change region ID. Constraints: This parameter is mandatory when ticket_type is set to change to create a change ticket. Value range: N/A Default value: N/A |
|
plan_task_sub_type |
No |
String |
Definition: Contingency plan subtype. Constraints:
Value range: Enumerated value CUSTOMIZATION: custom job COMMUNAL: public job Default value: N/A |
|
plan_task_id |
No |
String |
Definition: ID of the job to be executed. Constraints:
Value range: N/A Default value: N/A |
|
plan_task_name |
No |
String |
Definition: Name of the job to be executed. Constraints:
Value range: N/A Default value: N/A |
|
plan_task_params |
No |
String |
Definition: Parameter information required for executing a job. Constraints:
Value range: N/A Default value: N/A |
|
is_start_process |
No |
Boolean |
Definition: Whether to start the process.
Constraints: N/A Value range: N/A Default value: N/A |
|
sub_tickets |
No |
Array of TicketCreateSubTicketInfo objects |
Definition: Information about the change sub-ticket, including the service and region involved in the change ticket. Constraints:
Value range: N/A Default value: N/A |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
app_name |
No |
String |
Definition: Change service. Constraints: When target_type is set to change_scope, the Chinese name of the change service must be set. Value range: N/A Default value: N/A |
|
region |
No |
String |
Definition: Change region. Constraints: When target_type is set to change_scope, this parameter must be set to the corresponding change region ID. Value range: N/A Default value: N/A |
|
target_type |
No |
String |
Definition: Target option information. Different information can be transferred.
Constraints: N/A Value range: N/A Default value: N/A |
|
target_value |
No |
String |
Definition: Region ID of the change ticket. This parameter must be used together with target_type. Constraints: This parameter is valid only when target_type is set to child_ticket. Value range: N/A Default value: N/A |
|
expected_start_time |
No |
Long |
Definition: Timestamp of the planned start time of a change ticket. Constraints: This parameter is valid only when target_type is set to child_ticket. Value range: N/A Default value: N/A |
|
expected_end_time |
No |
Long |
Definition: Timestamp of the planned end time of a change ticket. Constraints: This parameter is valid only when target_type is set to child_ticket. Value range: N/A Default value: N/A |
|
executors |
No |
String |
Definition: Change ticket implementer. Constraints: This parameter is valid only when target_type is set to child_ticket. Value range: N/A Default value: N/A |
|
cooperators |
No |
String |
Definition: Change ticket collaborator. Constraints: This parameter is valid only when target_type is set to child_ticket. Value range: N/A Default value: N/A |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
provider_code |
String |
Definition: Service ID. Value range: N/A Default value: 049 |
|
error_code |
String |
Definition: Request response code. Value range: GOM.00000000~GOM.00009999999 Default value: GOM.00000000 |
|
error_msg |
String |
Definition: Response description for a request. Value range: N/A |
|
data |
data object |
Response body |
|
Parameter |
Type |
Description |
|---|---|---|
|
is_start_process_async |
Boolean |
Definition: Whether to start the process asynchronously. The value is fixed to true, indicating that the background ticket creation process is an asynchronous process. Value range: true Default value: true |
|
is_update_null |
Boolean |
Definition: Whether to resubmit the empty field Value range: false Default value: false |
|
is_return_full_info |
Boolean |
Definition: Whether to return all fields. Value range: false Default value: false |
|
is_start_process |
Boolean |
Definition: Whether to start the process. If this parameter is set to false, the created ticket is in the draft state. The preset value is true. The created ticket is in the unhandled state. Value range: true or false Default value: true |
|
ticket_id |
String |
Definition: ID of the newly created ticket. Value range: N/A Default value: N/A |
|
id |
String |
Definition: Unique ID of the newly created ticket. Value range: N/A Default value: N/A |
Status code: 400
|
Parameter |
Type |
Description |
|---|---|---|
|
provider_code |
String |
Definition: Service ID. Value range: N/A Default value: 049 |
|
error_code |
String |
Definition: Request response code. Value range: GOM.00000000~GOM.00009999999 Default value: GOM.00000000 |
|
error_msg |
String |
Definition: Response description for a request. Value range: N/A |
Example Requests
-
Create a change ticket.
POST https://{Endpoint}/v1/change/tickets { "title" : "Change ticket creation", "change_notes" : "Change ticket description. This is a test change ticket.", "change_type" : "change_type_conventional", "level" : "change_level_030", "change_scheme" : "change_scheme_guides", "change_guides" : "ad2997a2-ad31-4aed-a07b-eb22b132520a", "change_scene_id" : "GOCMLL01001", "current_cloud_service_id" : "6470681a31da2a47ed50a919", "location_id" : "xxx", "approve_type" : "or_sign", "is_start_process" : true, "sub_tickets" : [ { "target_type" : "change_scope", "app_name" : "COC application", "region" : "xxx", "resource_biz_id" : "6470681a31da2a47ed50a919" }, { "target_type" : "change_scope", "app_name" : "COC application", "region" : "xxx", "resource_biz_id" : "6470681a31da2a47ed50a919" }, { "target_type" : "child_ticket", "target_value" : "xxx", "expected_start_time" : 1750755723000, "expected_end_time" : 1750842123000, "executors" : "005b950b4863447cb97cd77a89559c79", "cooperators" : "0064670859f74dc89398d676d95e3577" }, { "target_type" : "child_ticket", "target_value" : "xxx", "expected_start_time" : 1750755733000, "expected_end_time" : 1750842134000, "executors" : "005b950b4863447cb97cd77a89559c79", "cooperators" : "0064670859f74dc89398d676d95e3577" } ], "plan_task_type" : "scheme_type_plan_task", "plan_task_sub_type" : "", "plan_task_id" : "", "plan_task_name" : "", "plan_task_params" : "" } -
Create an issue ticket.
POST https://{Endpoint}/v1/issues_mgmt/tickets { "title" : "sdk_test_create", "description" : "[Symptom] An issue ticket is created using the SDK.\n[Impact on the live network]", "commit_upload_attachment" : "", "regions" : "", "enterprise_project" : "0", "level" : "issues_level_4000", "ticket_type" : "issues_type_1000", "root_cause_cloud_service" : "6470681a31da2a47ed50a919", "source" : null, "source_id" : "", "fount_time" : 0, "virtual_schedule_type" : "issues_mgmt_virtual_schedule_type_2000", "issue_contact_person" : "51875a8200fd45189f94745678545bc3", "schedule_scenes" : "", "virtual_schedule_role" : "" }
Example Responses
Status code: 200
Request succeeded.
For more status codes, see Status Codes.
{
"error_code" : "GOM.00000000",
"error_msg" : null,
"provider_code" : 4,
"data" : {
"is_start_process_async" : true,
"is_update_null" : false,
"is_return_full_info" : false,
"is_start_process" : true,
"ticket_id" : "CM202506241152560174680890",
"id" : "f9990e23-188f-4979-b5e8-57d265cfc90d"
}
}
Status code: 400
The server failed to process the request.
For more status codes, see Status Codes.
{
"error_code" : "GOM.00007256",
"error_msg" : "Invalid parameter",
"provider_code" : 4,
"data" : null
}
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
Request succeeded. For more status codes, see Status Codes. |
|
400 |
The server failed to process the request. For more status codes, see Status Codes. |
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