Updated on 2025-10-24 GMT+08:00

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

Table 1 Path Parameters

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:

  • change

  • issues_mgmt

Default value:

N/A

Request Parameters

Table 2 Request body 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

  • change_type_conventional

  • change_type_urgentu

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:

  • This parameter is mandatory when ticket_type is set to change.

  • If the value is change_scheme_guides, the change_guides parameter is mandatory.

  • If the value is change_scheme_runbook, the plan_task_sub_type, plan_task_id, plan_task_name, and plan_task_params parameters are mandatory.

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:

  • This parameter is optional when ticket_type is set to issues_mgmt to create an issue ticket.

  • This parameter is mandatory when the value of source is issues_mgmt_associated_type_1000, issues_mgmt_associated_type_2000, or issues_mgmt_associated_type_3000. Enter the ID of the associated ticket.

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

  • issues_mgmt_virtual_schedule_type_1000: shift

  • issues_mgmt_virtual_schedule_type_2000: individual

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:

  • This parameter is mandatory when ticket_type is set to change to create a change ticket.

  • This parameter is mandatory when change_scheme is set to change_scheme_runbook.

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:

  • This parameter is mandatory when ticket_type is set to change to create a change ticket.

  • This parameter is mandatory when change_scheme is set to change_scheme_runbook.

Value range:

N/A

Default value:

N/A

plan_task_name

No

String

Definition:

Name of the job to be executed.

Constraints:

  • This parameter is mandatory when ticket_type is set to change to create a change ticket.

  • This parameter is mandatory when change_scheme is set to change_scheme_runbook.

Value range:

N/A

Default value:

N/A

plan_task_params

No

String

Definition:

Parameter information required for executing a job.

Constraints:

  • This parameter is mandatory when ticket_type is set to change to create a change ticket.

  • This parameter is mandatory when change_scheme is set to change_scheme_runbook.

Value range:

N/A

Default value:

N/A

is_start_process

No

Boolean

Definition:

Whether to start the process.

  • If the value is false, the created ticket is in the draft state.

  • The preset value is true. The created ticket is in the unhandled state.

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:

  • This parameter is mandatory and valid when ticket_type is set to change to create a change ticket.

  • This parameter can be left blank when ticket_type is not change.

Value range:

N/A

Default value:

N/A

Table 3 TicketCreateSubTicketInfo

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.

  • When the change application is set, this parameter is set to change_scope.

  • When the change plan is set, this parameter is set to child_ticket.

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

Table 4 Response body parameters

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

Table 5 data

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

Table 6 Response body parameters

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.