Help Center/ CodeArts/ User Guide/ Preparations/ Managing Project Notifications/ Setting Generic Webhook Subscriptions
Updated on 2025-08-14 GMT+08:00

Setting Generic Webhook Subscriptions

Scenario

CodeArts allows you to customize notifications to send user operation events to a third-party platform through HTTP.

The following table lists the supported services and event types.

Table 1 Event types

Service

Event Type

CodeArts Req

Raw requirement

  • Create/Submit
  • Edit
  • Delete
  • Change
  • Update status
  • Comment

System feature (SF)

  • Create
  • Edit
  • Delete
  • Change
  • Baseline/Unbaseline
  • Update status
  • Comment

R&D requirement (IR/SR/AR)

  • Create
  • Edit
  • Delete
  • Change
  • Baseline/Unbaseline
  • Move
  • Comment
  • Update status

Task

  • Create
  • Edit
  • Delete
  • Comment
  • Update status

Bug

  • Create/Submit
  • Edit
  • Delete
  • Move
  • Update status
  • Comment

Review

  • Submit
  • Transfer to others
  • Cancel/Reject
  • Change object reviewed
  • Change object decision-making completed
  • Review or decision-making completed
  • Delete
  • Comment

CodeArts Check

Check task

Completed

  • All
  • Gate check passed
  • Gate check failed

CodeArts Deploy

Application

  • Application deployed
  • Deploy application failed
  • Deploy stopped

CodeArts Pipeline

Pipeline

  • Completed
  • Failed
  • Paused
  • Suspended
  • Ignored

Constraints

  • This function is now available in the AP-Singapore region.
  • This function is supported only by IPD projects.

Prerequisites

You have created a CodeArts project, and your role in the project is Project Administrator or Project Manager.

Creating a Webhook

  1. Go to the CodeArts homepage.

    1. Log in to the CodeArts console, click , and select a region where you have enabled CodeArts.
    2. Click Go to Workspace.

      If your account uses the old billing mode (see Old Billing Modes), click Access Service.

  2. Click the target project name to go to the project.
  3. In the navigation pane, choose Settings > General > Notifications.
  4. Click the Generic Webhook tab.
  5. Select a service for which you want to configure notifications, and click New Webhook Subscription.
  6. Configure the parameters and click OK.

    Table 2 Creating a webhook

    Parameter

    Description

    Name

    The name of a generic webhook.

    URL

    URL of the HTTP server that will receive requests. Currently, only POST requests can be received.

    Event Types

    Event types that can trigger a generic webhook notification. For details about the supported event types, see Table 1.

    HTTP Request Headers

    HTTP request headers of the generic webhook notification. This parameter is optional. Configure it as needed.

    HTTP request headers are part of the HTTP protocol.

    When an event occurs, the service sends an HTTP request to the configured URL, along with any necessary HTTP request headers like those for authentication.

    Generally, an HTTP request header is in format "key: value", for example, Content-Type: application/json.

    Multiple request headers can be included in a single request, with each header on its own line. Each line should contain only one request header.

    A single request header is max. 100 characters. Up to 20 request headers are allowed.

    For more information about HTTP request headers, see HTTP documentation.

    Custom Template

    Set the request body with parameters enclosed in "${}". For example, ${eventName}. For details about the available parameters, see Event Data Structure.

    The new webhook subscription is displayed.

Event Data Structure

  • CodeArts Req
    Table 3 Dynamic parameters of CodeArts Req

    Dynamic Parameter

    Description

    ${project.id}

    Project ID

    ${project.url}

    Project URL

    ${issue.id}

    Work item ID

    ${issue.title}

    Work item title

    ${issue.url}

    Work item URL

    ${operator.username}

    Operator username

    ${operator.id}

    Operator ID

    ${review.id}

    Review ID

    ${review.title}

    Review title

    ${review.url}

    Review URL

    ${operation}

    Event name

    ${event.id}

    Event ID

    ${event.time}

    Event time

  • CodeArts Check
    {
    	"eventName": "Check completed",  // Event name
    "eventCode": "taskExecuteCompleted", // Event code
    	"project": {
    		"id": "", // Project ID
    		"url": "" // Code check project URL
    	},
    	"task" : {
        "id": "", // Task ID
        "name": "", // Task name
        "gitUrl": "",  // Repo URL
        "creator": ""  // Task creator
    	},
    	"job": {
        "id": "", // Execution ID
        "startTime": "", // Task execution start time
        "finishTime": "", // Task execution end time
        "status": "",  // Task status (successful, failed, or stopped)
        "gateResult": "", // Gate check result (passed or failed)
        "executor": "", // User who executed the task
        "url": "" // Execution record redirect link
    	},
    	"issues": {
        "critical": "", // Number of critical issues
        "major": "", // Number of major issues
        "minor": "", // Number of minor issues
        "suggestion": "" // Number of suggestions
    	}
    }
  • CodeArts Deploy

    Event Name

    Event Code

    Application deployed

    success

    Deploy application failed

    failure

    Deploy stopped

    stop

    {
      "eventName": "Application deployed",  // Event name
      "eventCode": "success",  // Event code
      "taskName": "", // Application name
      "projectName": "", // Project name
      "result": "", // Execution result
      "sort": "", // Execution ID
      "startUser": "", // Executed by
    	"startTime": "", // Execution time
    	"link":""// Deployment details link
    }
    
  • CodeArts Pipeline

    CodeArts Pipeline parameters are referenced using "${pipeline.parameter-name}", for example, ${pipeline.pipeline_id} for referencing a pipeline ID.

    The parameters that can be referenced are as follows:
    {
    	"pipeline": {
    		"pipeline_id": "", // Pipeline ID
          "run_number": "", // Pipeline execution ID
          "project_id": "", // ID of the project that the pipeline belongs to
    		"run_id": "", // Pipeline execution ID
          "timestamp": "", // Pipeline execution timestamp
          "trigger_type": "", // Pipeline trigger type
          "name": "" // Pipeline name
    	}
    }