Context is empty in condition used by client-side-extension

I am working on adding an option to BitBuckets pull request action menu. I have the new option showing up using client side extensions. I have created a condition that I have to the client side extension that checks to see if the option has been enabled for the current repo or not. The issue is that I am trying to use the context in the condition so I can pull setting for the repository, but the context is always empty. I need a way to know what repo and project I am in, in the condition so I can pull down some settings that I save using PluginSettings and PluginSettingsFactory. Is there something special I need to do to get the context when using extension points?

Hi @gluft, based on your message, I think you are talking about using server-side context and server-side conditions, right?

Unfournalty, the CSE doesn’t support server-side context yet. What you can do instead is to use the client-side context. Using the repository and project entities, you can send a request to Bitbucket REST API from the extension code. Please take a look at a similar question and the alternative solution here:

Maciej Adamczak
Atlassian Developer

Thank you for the response @madamczak . As I already had a rest endpoint storing information this worked perfectly for what I needed.

1 Like