Skip to content

FR : Support Bitbucket Server clone links in webhook payloads #3961

@tarikflz

Description

@tarikflz

Feature Request: Add Bitbucket Server webhook compatibility

Problem

Currently, Lagoon’s Bitbucket webhook handler expects payload fields like:

  • repository.links.html.href
  • repository.full_name

However, these fields are not present in Bitbucket Server (formerly known as Stash) webhook payloads. Instead, Bitbucket Server provides SSH and HTTP(S) clone URLs under:

"repository": {
  "links": {
    "clone": [
      { "href": "ssh://[email protected]:7999/project/repo.git", "name": "ssh" },
      { "href": "https://bitbucket.mycompany.com/scm/project/repo.git", "name": "http" }
    ]
  }
}

This causes Lagoon’s webhook handler to throw an error:

Cannot read properties of undefined (reading 'href')

Proposed Solution

Enhance the Bitbucket webhook handler to:

  • Check for repository.links.clone
  • Prefer the sshclone link if available
  • Fallback to current behavior (html.href + full_name) for backward compability with Bitbucket Cloud

Reference

📄 Bitbucket Server webhook documentation:
https://confluence.atlassian.com/bitbucketserver064/event-payload-974388877.html#Eventpayload-repositoryevents

Benefit

This change would allow teams using Bitbucket Server or Data Center editions to integrate with Lagoon natively via webhooks, without custom patches or middleware.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions