ExportXMLWordPrintable

      Build status notifications should be posted to Bitbucket with the user configured in the pipeline and only fallback to the PAT configured in the global plugin config. Otherwise the globally accessible PAT needs to be given read access to all repositories, which can be a security issue.

      Expected Behaviour

      When overriding the credentials ("Credentials (for build auth)") in the plugin config in a multibranch pipeline, these credentials should be used (or they should be used to generate an access token for given user) to post build status notifications to Bitbucket.

      Observed Behaviour

      The build status notifications are posted using the personal access token configured in the global plugin configuration. In the Bitbucket access log, I can see the access token ID that was used:

      atlassian-bitbucket-access-2026-07-07.36.log:,0:0:0:0:0:0:0:1 | https | o@12VHS3Lx948x53823030x1 | jenkins-bitbucket-techuser | 2026-07-07 15:48:36,751 | "POST /rest/api/1.0/projects/MYPROJ/repos/myrepo/commits/e74ac6e2d2bd49c4c6dff3101520be5a67bd68db/builds HTTP/1.1" | "" "bitbucket-jenkins-integration/5.0.1" | 401 | 0 | 137 | access-token:id:8656061308719 | 18 | - | 

      The access token in the log, matches the one configured in the global config.

      Reproduction

      1. Configure a PAT for Bitbucket user X in the global plugin config, that has no access to repository A
      2. Create a multibranch pipeline, configure the plugin to use the credentials of Bitbucket user Y, which has admin access to repository A
      3. Run the pipeline
      4. The notification will fail in the pipeline with `
        Failed to post build status, additional information: Provided credentials cannot access the resource
         

            Assignee:
            Unassigned
            Reporter:
            Steven
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: