en
de
November 2018

A Plugin for Atlassian Jira – User Experience

12 December 2000
| |
Reading time: 3 minutes

Previous Page | Next Page | Pages: 0 1 2 3 4 5 6 7

Customise the plugin

Go on to the next page of the tutorial. However, you can skip the creation of the “mySection” and “myItem” plugin modules.

If you wish to include a Web UI in your plugin, which is the usual situation, the recommended way to create an initial landing page is to use the command atlas-create-jira-plugin-module to add plugin modules of type Web Item (25) and Web Panel (26). The web item comes first, even though it has to reference the web panel, which comes second.

Below, I specify jira.project.sidebar.plugins.navigation as the location where the new menu item should appear. This corresponds to the left-hand menu displayed when the user has navigated to a specific project. I have been unable to find a consolidated list of Jira user interface locations (called sections) where web items, pages, panels and so on can be inserted. Here are some you may find useful:

Atlassian also recommends a third-party utility called Web fragments to find sections/locations.

New menu entry with custom icon added to Atlassian Jira

Assuming you wish to use an icon that resembles those of the existing menu items, create this as e.g. arrows.png and store it in the folder src/main/resources/images before you begin. Note that it is extremely difficult to discover in Atlassian’s published documentation how to access an image you have added to the above folder. The correct URL for a Jira web resource is shown below.

Alternatively, define the icon as a SVG drawing embedded in a stylesheet, as the system icons are. Such icons are referenced from within atlassian-plugin.xml using a style reference, so you would omit the advanced setup from the web item in the dialog below, and instead edit the file directly afterwards. See below.

$ atlas-create-jira-plugin-module 
Executing: /Applications/Atlassian/atlassian-plugin-sdk-6.3.12/apache-maven-3.2.1/bin/mvn com.atlassian.maven.plugins:maven-jira-plugin:6.3.21:create-plugin-module -gs /Applications/Atlassian/atlassian-plugin-sdk-6.3.12/apache-maven-3.2.1/conf/settings.xml
readlink: illegal option -- f
usage: readlink [-n] [file ...]
Warning: JAVA_HOME environment variable is not set.
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256M; support was removed in 8.0
[INFO] Scanning for projects...
[INFO] 
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building myPlugin 1.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-jira-plugin:6.3.21:create-plugin-module (default-cli) @ myPlugin ---
Choose Plugin Module:
...
25: Web Item
26: Web Panel
...
Choose a number (1/2/3/4/5/6/7/8/9/10/11/12/13/14/15/16/17/18/19/20/21/22/23/24/25/26/27/28/29/30/31/32/33/34): 25
[INFO] Google Analytics Tracking is enabled to collect AMPS usage statistics.
[INFO] Although no personal information is sent, you may disable tracking by adding <allowGoogleTracking>false</allowGoogleTracking> to the amps plugin configuration in your pom.xml
[INFO] Sending event to Google Analytics: AMPS:jira - Create Plugin Module - jira:Web Item
Enter Plugin Module Name My Web Item: : metrics-page-item
Enter Section (e.g. system.admin/globalsettings): jira.project.sidebar.plugins.navigation
Enter Link URL (e.g. /secure/CreateIssue!default.jspa): /projects/${pathEncodedProjectKey}?selectedItem=com.atlassian.jira.jira-projects-plugin:metrics-page
Show Advanced Setup? (Y/y/N/n) N: : y
Module Key metrics--page--item: : 
Module Description The metrics-page-item Plugin: : Menu item for Metrics Page
i18n Name Key metrics--page--item.name: : 
i18n Description Key metrics--page--item.description: : 
Weight 1000: : 
Link Id metrics--page--item-link: : 
Enter Label Key metrics--page--item.label: : 
Enter Label Value metrics-page-item: : Agile Metrics
Add Label Param? (Y/y/N/n) N: : 
Add Icon? (Y/y/N/n) N: : y
Icon Location (e.g. /images/icons/print.gif): ${baseurl}/download/resources/${atlassian.plugin.key}:myPlugin-resources/images/arrows.png
Icon Width 16: : 32
Icon Height 16: : 32
Add Tooltip? (Y/y/N/n) N: : 
Add Resource (Y/y/N/n) N: : 
Add Velocity Context Provider (Y/y/N/n) N: : 
Add Plugin Module Param? (Y/y/N/n) N: : 
Add Conditions? (Y/y/N/n) N: : 
[INFO] Adding the following items to the project:
[INFO]   [dependency: org.mockito:mockito-all]
[INFO]   [module: web-item]
[INFO]   i18n strings: 3
Add Another Plugin Module? (Y/y/N/n) N: : y
Choose Plugin Module:
...
25: Web Item
26: Web Panel
...
Choose a number (1/2/3/4/5/6/7/8/9/10/11/12/13/14/15/16/17/18/19/20/21/22/23/24/25/26/27/28/29/30/31/32/33/34): 26
Enter Plugin Module Name My Web Panel: : metrics-page
Enter Location (e.g. system.admin/globalsettings): com.atlassian.jira.jira-projects-plugin:metrics-page
Show Advanced Setup? (Y/y/N/n) N: : y
Module Key metrics--page: : 
Module Description The metrics-page Plugin: : Agile Metrics page
i18n Name Key metrics--page.name: : 
i18n Description Key metrics--page.description: : 
Weight 1000: : 
Add Resource (Y/y/N/n) N: : y
Enter Resource Name (leave blank to use namePattern): view
Enter Resource Type download: : velocity
Enter Location (path to resource file): templates/tabpanels/metrics-tab-panel.vm
Add Resource Parameter? (Y/y/N/n) N: :
Add Resource (Y/y/N/n) N: : 
Add Velocity Context Provider (Y/y/N/n) N: : y
Enter Fully Qualified Context Provider Class com.zuhlke.training.jira.web.contextproviders.MyContextProvider: : com.zuhlke.training.jira.impl.MetricsInfoImpl
Add Conditions? (Y/y/N/n) N: : 
[INFO] Adding the following items to the project:
[INFO]   [dependency: org.mockito:mockito-all]
[INFO]   [module: web-panel]
[INFO]   i18n strings: 2
Add Another Plugin Module? (Y/y/N/n) N: : 
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 03:38 min
[INFO] Finished at: 2018-11-22T14:14:13+00:00
[INFO] Final Memory: 26M/378M
[INFO] ------------------------------------------------------------------------

As an alternative to an icon element containing a link to a web resource image file, stylesheet icons are referenced like this (e.g. the “reports” icon):

<param name="iconClass" value="aui-icon-large agile-icon-report aui-iconfont-graph-line"/>

Previous Page | Next Page | Pages: 0 1 2 3 4 5 6 7

Comments (0)

×

Sign up for our Updates

Sign up now for our updates.

This field is required
This field is required
This field is required

I'm interested in:

Select at least one category
You were signed up successfully.

Receive regular updates from our blog

Subscribe

Or would you like to discuss a potential project with us? Contact us »