Hi, we’ve been evaluating Forge for Bitbucket Cloud and want to use the commit statuses endpoints to send build information to Bitbucket. We’re running into a problem there and don’t know what else we could try, so seeking for some suggestions or help here…
In a Forge resolver function, we’re pushing data to the Bitbucket API like this:
const cloudId = '{...}';
const repoUuid = '{...}';
const commitId = '...';
const payload = {}; // see below
const response = await api.asApp().requestBitbucket(route`/2.0/repositories/${cloudId}/${repoUuid}/commit/${commitId}/statuses/build`, {
method: 'POST',
body: JSON.stringify(payload),
});
console.info(`response: ${response.status} ${response.statusText} ${await response.text()}`);
The payload looks like this:
{
"type": "build",
"state": "INPROGRESS",
"url": "https://...",
"name": "Build Test",
"key": "3c464800-f2d2-11f0-bb13-325096b39f47",
"description": "Test Build #3c464800-f2d2-11f0-bb13-325096b39f47",
"created_on": "2026-01-16T11:01:01.599384+00:00"
}
The response we get from Bitbucket’s API:
400 Bad Request {"type": "error", "error": {"message": "Bad request"}}
There’s no info what’s wrong or whatever. We even tried to provide more fields or remove some or used different time formats, key formats, etc. but nothing helped. We also tried to use the workspace and repository slugs but that didn’t help either.
The Forge app has the following permissions:
read:repository:bitbucketwrite:repository:bitbucketadmin:repository:bitbucketread:workspace:bitbucket
According to the Bitbucket API docs, only read:repository:bitbucket should be necessary for adding build status information. Since that’s kind of weird that read is required instead of write, we added more permissions for testing purposes but that didn’t help.
We can access other endpoints like /2.0/repositories/{uuid} to get the repositories of a workspace or /2.0/repositories/{uuid}/{repoUuid} to get one repository and we can even access the “list commit statuses for a commit” endpoint, so I don’t think it’s a permission problem.
Did anyone experience similar issues or has some suggestions?