6

Every pipeline execution has their own URL (I think is a kind of UUID?).

It's possible to get that URL or UUID to compose the URL?

I have a command inside my tasks triggering messages using a REST/API call, but I want to include a link to the pipeline that triggered the message.

Gonzalo
  • 468
  • 1
  • 7
  • 17

1 Answers1

8

You can try doing it with default variables in pipelines. The ones you need are:

  • $BITBUCKET_GIT_HTTP_ORIGIN - the URL for the origin (e.g. http://bitbucket.org/<account>/<repo>).

  • $BITBUCKET_BUILD_NUMBER - the unique identifier for your build.


For the time of writing this answer, the following combination works:

$BITBUCKET_GIT_HTTP_ORIGIN/addon/pipelines/home#!/results/$BITBUCKET_BUILD_NUMBER
Michal Karbownik
  • 1,138
  • 14
  • 28
  • 1
    This is the correct answer, but a brittle solution. BitBucket should provide this as an environment variable in the build... – Moritz Friedrich Nov 03 '22 at 08:49
  • 1
    For me the url doesn't contain 'addon' at all, but rather looks like `$BITBUCKET_GIT_HTTP_ORIGIN/pipelines/results//steps/`. Totally agree with @MoritzFriedrich. – Christian Nov 15 '22 at 14:07