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
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
Hi Fabian,
Thanks for your fast help. Now we can parse workspace id-s :)
Cheers,
István
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.