Configure webhooks in GitLab manually

  • Release version: Washingtondc
  • Updated August 1, 2024
  • 1 minute to read
  • Configure webhooks in GitLab manually to send job, push, and issues notifications to the DevOps application.

    Before you begin

    Role required:
    • sn_devops.admin or sn_devops.tool_owner in DevOps Change Velocity
    • GitLab admin

    About this task

    Create webhooks for the following two triggers in GitLab for every project you want to track.
    • Push events (code capability)
    • Job events (orchestration capability)
    • Issues events (planning capability)

    You can also access manual configuration from the GitLab tool record in DevOps Change Velocity.

    Procedure

    1. In GitLab, navigate to Project > Settings > Webhooks and add a webhook.
    2. In DevOps Change Velocity, choose Configure manually when configuring the tool instance to send data.

      GitLab configure webhooks manually.

      Note:
      You can also access manual configuration from the GitLab tool record in DevOps Change Velocity. From the tool record, select Configure > Configure manually.
    3. Copy the Webhook URL field from DevOps Change Velocity connection details for GitLab.
      Note:
      Select Copy in the appropriate field to copy the value to your clipboard. The field label changes to Copied, but you can copy multiple times.

      Copy webhook details.

    4. Modify the copied Webhook URL to reflect your tool details, and paste the URL in GitLab.

      For example:

      https://<your instance>.service-now.com/api/sn_devops/v2/devops/tool/{code | plan | artifact | orchestration | test | softwarequality }?toolId=<your ToolId>

      1. Select one of the tool capabilities {code | plan | artifact | orchestration | test | softwarequality } to match your tool.
        For example:

        https://<your instance>.service-now.com/api/sn_devops/v2/devops/tool/code?toolId=<your ToolId>

      2. Copy the modified Webhook URL to the URL field of the new webhook in your GitLab instance.
    5. Copy the Secret token field from the ServiceNow instance connection details for GitLab, and paste in the Secret Token field of the new webhook in your GitLab instance.
      Table 1. Copy field values
      From DevOps Change Velocity To GitLab
      Webhook URL (modified) URL
      Secret token Secret Token
    6. Select the check boxes for Push events, Tag push events, Comments, and Merge request events for coding capability events.

      GitLab push events for code capability.

    7. Select Add webhook.
    8. Repeat the procedure to create webhooks for planning and orchestration capability events in GitLab.
      • For orchestration: Select the check boxes for Job events and Pipeline events. GitLab Job events.
      • For planning: Select the check boxes for Issues events and Confidential issues events. GitLab Issues events
    9. Select Add webhook.

      GitLab webhooks for DevOps Change Velocity integration:

      Webhooks configured in GitLab.