Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Unable to set styleClass when adding button to bitbucket.pullrequest.action?

David Schlesinger March 14, 2017

I'm writing a Bitbucket server plugin that adds a client-web-item to bitbucket.pullrequest.action.

Previously, I would add buttons as web-items to bitbucket.pull-request.toolbar.actions, set the styleClass, then request the button through jQuery by calling the style class. Because bitbucket.pull-request.toolbar.actions is gone, I'm now adding the buttons as client-web-items to bitbucket.pullrequest.action. This means the buttons appear in the drop down list on pull request pages.

I'm able to get a button to show up through the following xml:

<client-web-item key="my-button" name="Repositories Global web item" weight="30" section="bitbucket.pullrequest.action">
    <label>my-button-label</label>
</client-web-item>

However, if I add the following styleClass to the previous block:

<styleClass>custom-button</styleClass>

the button disappears from the drop down. I'd like to be able to grab the button in my javascript like I did with web-items, by calling:

myButton = jQuery(" .custom-button");

Am I using bitbucket.pullrequest.action incorrectly?

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Kaushik Veluru March 15, 2017

The documentation for client-web-item says, for styleClass :  "Defines an additional CSS class that may be added to this web item when it is rendered on the page. Note that this value may be ignored in some situations. "

https://developer.atlassian.com/bitbucket/server/docs/latest/reference/plugin-module-types/client-web-item.html

I am not sure when it will be ignored. But could that be a lead? Let me know if you find something. 

Thanks. 

TAGS
AUG Leaders

Atlassian Community Events