Configure a webhook to subscribe to GitLab with a ServiceNow callback URL.

Before you begin

  • Request Integration Hub subscription
  • Activate the GitLab spoke
  • Role required: admin

Register GitLab webhook in ServiceNow instance

Register GitLab in ServiceNow to notify the ServiceNow app when certain events occur in GitLab.

Before you begin

Role required: admin

Procedure

  1. Navigate to All > GitLab Webhooks > GitLab Webhook Registries.
  2. To retrieve the existing webhooks GitLab account, click Get All Webhooks.
  3. To create a webhook, click New.
  4. On the form, fill in the fields:
  5. Click the Generate Secret Token related link.
    The secret token is generated and displayed. Also, the date on which the secret expires is populated in Secret Expires.
    Note: The secret is regenerated and updated every 30 days. This secret is also updated in GitLab.
  6. Right-click the form header and click Save.
  7. Click Create Webhook.
    The webhook is created in GitLab and its ID is populated in Webhook ID.

What to do next

To update details of the webhooks or change the subscribed events, click Update Webhook.

Customize a bi-directional webhook in the GitLab spoke

Create webhook routing policy and subflow as per your requirement in the GitLab spoke.

Before you begin

Role required: admin

About this task

The default routing policy in the GitLab WebHook Routing Policies modules triggers the relevant GitLab subflow and notifies the ServiceNow app when certain events occur in GitLab. To use any other fields in your custom subflow and customize conditions in the routing policy, perform these steps.

Procedure

  1. Navigate to All > Flow Designer > Designer.
  2. Click Subflows.
  3. Create a copy of the required subflow.
  4. Customize the required subflow as per your requirement and publish it.
    See Building subflows for more information about creating and using subflows and GitLab spoke for information about the GitLab fields that the default routing policy supports and the GitLab events that the subflows support.
  5. Navigate to All > GitLab Webhooks > GitLab Webhook Routing Policies.
    Five routing policies are available along with the spoke. You can configure them as per your requirement or create a routing policy.
  6. To create a routing policy, click New.
  7. On the form, fill in the fields.
  8. Click Submit.
    Note: These routing policies are saved in the Decision tables. Users are cautioned against directly updating or modifying data in these tables.

Result

Routing policy and subflow are created.