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

Obtaining an Incident Task

Function

This API is used to obtain an incident task.

Before calling this API, perform the following operations.

Authorization

Each account has all of the permissions required to call all APIs, but IAM users must have the required permissions specifically assigned.

  • If you are using role- or policy-based authorization, refer to Permissions Policies and Supported Actions to obtain the permissions required.
  • If you are using identity policy-based authorization, the permission listed below is required.

    Action

    Access Level

    Resource Type (*: required)

    Condition Key

    Alias

    Dependent Action

    coc:ticket:listActions

    List

    -

    -

    -

    -

URI

GET /v2/incidents/{incident_id}/tasks

Table 1 Request path parameters

Parameter

Type

Mandatory

Description

incident_id

String

Yes

Definition:

Incident ticket No.

Constraints

String

Range:

Length: 1 to 50 characters

Default Value:

N/A

Response Parameters

Status code: 200

Table 2 Response body parameters

Parameter

Type

Description

provider_code

String

Definition:

Service ID.

Range:

N/A

Default Value:

049

error_code

String

Definition:

Request response code.

Range:

GOM.00000000~GOM.00009999999

Default Value:

GOM.00000000

error_msg

String

Definition:

Response description for a request.

Range:

N/A

Default Value:

N/A

data

Arrays of CocTaskDetailV2

Definition:

Result list.

Range:

Array length: 0 to 1,000 characters

Default Value:

N/A

Table 3 CocTaskDetailV2

Parameter

Type

Mandatory

Description

type

String

No

Definition:

Node type.

Range:

Length: 0 to 1,000 characters

Default Value:

0

name

String

No

Definition:

Node name.

Range:

Length: 0 to 1,000 characters

Default Value:

0

key

String

No

Definition:

Node key.

Range:

Length: 0 to 1,000 characters

Default Value:

N/A

state

String

No

Definition:

Status. The value can be running or suspend.

Range:

Length: 0 to 1,000 characters

Default Value:

N/A

operations

Arrays of CocTaskOperationDetailV2

No

Definition:

Operations.

Range:

Array length: 0 to 1,000 characters

Default Value:

N/A

Table 4 CocTaskOperationDetailV2

Parameter

Type

Mandatory

Description

task_id

String

No

Definition:

Task ID, which is required for subsequent operations.

Range:

Length: 0 to 255 characters

Default Value:

N/A

key

String

No

Definition:

Operation key, which is required for subsequent operations.

Range:

Length: 0 to 255 characters

Default Value:

N/A

Request Examples

Obtain the tasks supported by an incident ticket.

GET https://{Endpoint}/v2/incidents/{incident_id}/tasks

Response Examples

Status code: 200

Request result is returned.

For more status codes, see Status Codes.

{
    "provider_code": "049",
    "error_code": "GOM.00000000",
    "error_msg": null,
    "data": [
        {
            "type": "OperateNode",
            "key": "userTaskHandle1",
            "name": "Processing",
            "state": "running",
            "operations": [
                {
                    "task_id": "19102976566880092186683",
                    "key": "commitSolution1"

                },
                {
                    "task_id": "19102976566880092186683",
                    "key": "forwardOther1"
                },
                {
                    "task_id": "19102976566880092186683",
                    "key": "AddRemark"

                },
                {
                    "task_id": "19102976566880092186683",
                    "key": "incidentChangeLevel1"

                },
                {
                    "task_id": "19102976566880092186683",
                    "key": "incidentPause"
                }
            ]
        }
    ]
}

Status code: 400

The server failed to process the request.

For more status codes, see Status Codes.

{
  "error_code" : "GOM.00007256",
  "error_msg" : "Parameter error",
  "provider_code" : "049",
  "data" : null
}

Status Codes

Status Code

Description

200

Request result is returned.

For more status codes, see Status Codes.

400

The server failed to process the request.

For more status codes, see Status Codes.

Error Codes

For details, see Error Codes.