Skip to content

Commit fa5563b

Browse files
committed
Retrieves branch-associated Bitbucket issue
(#4047, #4119)
1 parent 756073a commit fa5563b

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

src/plus/integrations/providers/bitbucket.ts

+11-4
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,18 @@ export class BitbucketIntegration extends HostingIntegration<
9696
}
9797

9898
protected override async getProviderIssue(
99-
_session: AuthenticationSession,
100-
_repo: BitbucketRepositoryDescriptor,
101-
_id: string,
99+
{ accessToken }: AuthenticationSession,
100+
repo: BitbucketRepositoryDescriptor,
101+
id: string,
102102
): Promise<Issue | undefined> {
103-
return Promise.resolve(undefined);
103+
return (await this.container.bitbucket)?.getIssue(
104+
this,
105+
accessToken,
106+
repo.owner,
107+
repo.name,
108+
id,
109+
this.apiBaseUrl,
110+
);
104111
}
105112

106113
protected override async getProviderPullRequestForBranch(

src/plus/integrations/providers/utils.ts

+3
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ export function getProviderIdFromEntityIdentifier(
105105
return IssueIntegrationId.Jira;
106106
case EntityIdentifierProviderType.Azure:
107107
return HostingIntegrationId.AzureDevOps;
108+
case EntityIdentifierProviderType.Bitbucket:
109+
return HostingIntegrationId.Bitbucket;
108110
default:
109111
return undefined;
110112
}
@@ -228,6 +230,7 @@ export async function getIssueFromGitConfigEntityIdentifier(
228230
identifier.provider !== EntityIdentifierProviderType.Gitlab &&
229231
identifier.provider !== EntityIdentifierProviderType.GithubEnterprise &&
230232
identifier.provider !== EntityIdentifierProviderType.GitlabSelfHosted &&
233+
identifier.provider !== EntityIdentifierProviderType.Bitbucket &&
231234
identifier.provider !== EntityIdentifierProviderType.Azure
232235
) {
233236
return undefined;

0 commit comments

Comments
 (0)