Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

create a web item plugin

Olivera Tancheva January 17, 2019

hello I created a new jira plugin of type web-item, but I want to create an item same as the "Create" button. Where to find this type of button?

Thanks

1 answer

2 votes
Rafael Pinto Sperafico
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 17, 2019

Hi @Olivera Tancheva,

If you follow the example described in https://developer.atlassian.com/server/jira/platform/adding-menu-items-to-jira/, you should append the following to atlassian-plugin.xml:

<web-item key="my_links_link" name="Link on My Links Main Section" section="system.top.navigation.bar" weight="47">
<label>My Create Button</label>
<resource type="velocity" name="view" location="my-create-button.vm"/>
</web-item>

In which describes elements that can be used by a web-item. In this case we will be using <resource /> 

Then, create a file my-create-button.vm under resources directory paste the Split buttons content as below mentioned in link, e.g:

<div id="my_links_link" class="aui-buttons">
<button class="aui-button aui-button-split-main">Split main</button>
<button class="aui-button aui-dropdown2-trigger aui-button-split-more" aria-controls="split-container-dropdown">Split more</button>
</div>
<!-- Be sure to put your dropdown markup outside the button group...
otherwise the buttons will get jaggy edges! -->
<aui-dropdown-menu id="split-container-dropdown">
<aui-item-link>Menu item 1</aui-item-link>
<aui-item-link>Menu item 2</aui-item-link>
<aui-item-link>Menu item 3</aui-item-link>
</aui-dropdown-menu>

Please review what is the Atlassian AUI version the Atlassian application you will be running your plugin on has. For that, you could simply go to your Atlassian application on a web browser, then open up the Development Panel or Inspect, e.g Opening the Web Console.

With the web console open, run the following command:

AJS.version

The output should be used to search for the Atlassian AUI version, so you can review which elements / script are available to your application. In your case, it seems you are attempting on creating Split buttons located in https://docs.atlassian.com/aui/8.1.0/docs/buttons.html

Kind regards,

Rafael

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events