Where can I find the workspace id in the Custom UI resolver context?

István Nagy
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 30, 2023

Dear Forge Bitbucket Team,

Currently, the resolver context does not contain the workspace ID, which is needed for almost every API call.

Workspace-related API calls are not yet supported in Forge at the moment.

Is there any method, besides the UI Kit, to obtain the workspace ID?

Thanks,

István

3 answers

1 accepted

Suggest an answer

Log in or Sign up to answer
2 votes
Answer accepted
Fabian Siegel
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 30, 2023

Hi there,

not the Forge Bitbucket Team, but as a workaround, you can get it from the the installContext. In my experiments I used:

const workspaceId = `{${context.installContext.split('/')[1]}}`

 The additional {} brackets are needed for the API when using the workspaceId and not the workspace name.

Obviously it should just be in the context in a resolver :)

Cheers, Fabian

István Nagy
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 30, 2023

Hi Fabian,

Thanks for your fast help. Now we can parse workspace id-s :)

Cheers,

István

Like Caterina Curti likes this
0 votes
Wendy G
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 12, 2023

Hi @István Nagy @Fabian Siegel,

Just to let you know that we've recently added workspaceId field in the context for custom UI/UI Kit 2, so you can access it in resolver context now. See https://developer.atlassian.com/cloud/bitbucket/changelog/#CHANGE-1296 for more details.

Thanks

Wendy

0 votes
Hillary Chan
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 30, 2023

Hi @István Nagy 

We are aware that the workspace ID is not easily obtained from the resolver context. We have a ticket in our backlog to address this.

In the meantime, @Fabian Siegel's answer is our current recommended workaround for obtaining the workspace ID.

TAGS
AUG Leaders

Atlassian Community Events