Setting up Bitrix24 integration with GitLab

Our company is engaged in the development, support and maintenance of Bitrix and Bitrix24 solutions of any complexity. From simple one-page sites to complex online stores, CRM systems with 1C and telephony integration. The experience of developers is confirmed by certificates from the vendor.
Our competencies:
Development stages
Latest works
  • image_website-b2b-advance_0.png
    B2B ADVANCE company website development
    1175
  • image_bitrix-bitrix-24-1c_fixper_448_0.png
    Website development for FIXPER company
    811
  • image_bitrix-bitrix-24-1c_development_of_an_online_appointment_booking_widget_for_a_medical_center_594_0.webp
    Development based on Bitrix, Bitrix24, 1C for the company Development of an Online Appointment Booking Widget for a Medical Center
    564
  • image_bitrix-bitrix-24-1c_mirsanbel_458_0.webp
    Development based on 1C Enterprise for MIRSANBEL
    747
  • image_crm_dolbimby_434_0.webp
    Website development on CRM Bitrix24 for DOLBIMBY
    655
  • image_crm_technotorgcomplex_453_0.webp
    Development based on Bitrix24 for the company TECHNOTORGKOMPLEKS
    976

Setting up Bitrix24 Integration with GitLab

Developers keep code in GitLab, managers keep tasks in Bitrix24. A merge request has been under review for three days, but in B24 the task is marked "In Progress" — manager thinks the developer is still writing code. CI/CD pipeline failed on staging, but nobody finds out until QA writes "nothing works." Without a link between GitLab and B24, the two systems live in parallel, and coordination happens through chat — unreliable and slow.

Integration Architecture

The integration works through GitLab Webhooks and B24 REST API. GitLab allows configuring webhooks at the project or group level (Settings → Webhooks). Middleware receives events, extracts data, and translates them to B24.

GitLab (push/MR/pipeline) → Webhook → Middleware → B24 REST API → Tasks/Chat
B24 (task event) → Webhook → Middleware → GitLab API v4 → Issues/Labels

GitLab webhooks send JSON payload with X-Gitlab-Token header for authentication. Middleware checks the token on each request.

Notifications to B24

Middleware routes GitLab events to B24 chats and tasks:

GitLab Event B24 Action Recipient
Push Events Message to project chat Project participants
Merge Request Events Notification + task status update Responsible person
Pipeline Events Message to project chat Project participants
Note Events (comments) Comment in linked task Executor
Release Events Message to general chat Everyone
Deployment Events Comment in task + notification QA, manager

Messages are formatted with BB-codes: links to MR, pipeline, commits. For pipeline, middleware indicates status (success, failed, canceled) and duration.

Linking Merge Requests to Tasks

A developer specifies the B24 task ID in the MR description or in the branch name: feature/B24-2103-payment-gateway. Middleware extracts the ID and links the MR to the task.

MR lifecycle is reflected in task status:

  1. MR created → task moves to "Under Review." Middleware calls tasks.task.update.
  2. MR gets approve (Approval Rules) → task moves to "Review Passed."
  3. MR merged → task moves to "Completed" or "Testing."
  4. MR closed → task returns to "In Progress."

Middleware tracks these events via webhook trigger Merge Request Events and payload field object_attributes.action (open, close, merge, approved).

CI/CD Status in Tasks

Pipeline status is one of the key metrics for a manager. Middleware adds pipeline information to B24 task:

  • Pipeline passed → comment in task: "CI/CD passed, commit {sha}, branch {ref}." Custom field UF_CI_STATUS = passed.
  • Pipeline failed → comment with failed stage and log link. Notification to commit author in DM.
  • Pipeline for MR → status shown in task comment alongside MR info.

For pipeline details, middleware calls GitLab API: GET /api/v4/projects/{id}/pipelines/{pipeline_id}/jobs — list of jobs with statuses and logs.

Syncing B24 Tasks and GitLab Issues

When needed, middleware syncs B24 tasks with GitLab Issues:

B24 Field GitLab Issue Field Note
TITLE title Direct match
DESCRIPTION description HTML → Markdown
RESPONSIBLE_ID assignee_ids Via user mapping
PRIORITY labels (priority::*) Scoped labels
STATUS labels (workflow::*) Scoped labels
GROUP_ID (project) project_id Mapping table

GitLab uses scoped labels for workflow — middleware creates and assigns labels via PUT /api/v4/projects/{id}/issues/{iid}.

Deploy Tracking

GitLab Environments and Deployments API provide information about where and when code was deployed:

  • Webhook Deployment Events contains environment, status, deployable_url.
  • Middleware writes to task: "Deployed to {environment}, URL: {url}."
  • For production deploys — separate notification to releases channel.

Authentication

  • GitLab: Project Access Token or Personal Access Token with scope api. For self-hosted GitLab — same mechanism with custom URL.
  • B24: OAuth 2.0 with scope task,im,user.
  • Webhook secret token is stored in middleware and checked on each incoming request via X-Gitlab-Token header.

What We Implement

  • Middleware connecting GitLab projects to B24 tasks and chats
  • Notifications about push, merge requests, pipeline, and deploys
  • Automatic task status updates across MR lifecycle
  • CI/CD status display in B24 tasks
  • Bidirectional sync between B24 tasks and GitLab Issues
  • Deploy tracking with environment-specific notifications