Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Wiki Markup
{iframe:src=http://update.sonarsource.org/plugins/jira.html|width=700|height=250|frameborder=0}
Your browser does not support iframes.
{iframe}

Compatibility Matrix

...

Plugin

...

0.1

...

0.2

...

0.2.1

...

0.3

Description / Features

This plugin connects SonarQube to Altassian JIRA in various ways.

Widget JIRA Issues

SonarQube retrieves the number of issues associated with a project from JIRA. It then reports on the total number of issues and distribution by priority.

Image Added

Link a SonarQube issue to a JIRA ticket

This feature allows you to link a SonarQube issue to a JIRA issue by creating a new JIRA ticket for the SonarQube issue.

When logged in, you should find the "Link to JIRA" action available on any issue:

Image Added

After you press "Link to JIRA", a new review comment is added on the issue: you can see the link to the newly-created JIRA ticket.

Image Added

And the corresponding JIRA looks like:

Image Added

Requirements

Jira 3x(tick)only 13 (tick)

Plugin

1.01.11.11.2

Jira 3.

x

(tick)

(tick)(tick)(tick)

Jira 4.x

(minus)

(plus)

(tick)

(tick)(tick)(tick)

Jira 5.x

(question)(tick)(question)

(tick)

(question)

(tick)(tick)

Jira 6.x

(error)

(error)(error)(tick)

Description / Features

This plugin connects Sonar to Altassian JIRA in various ways.

Widget "JIRA Issues"

Sonar retrieves the number of issues associated to a project from JIRA. It then reports on the total number of issues and distribution by priority.

In order to get it working, you should first make some configuration:

...

Go to your Jira and create filter. Mark it as a favorite. Also you can share this filter with your team in order to allow usage of URL for issues in Sonar.

...

Then from a project dashboard (or from the global configuration), go to "Settings -> JIRA", and specify the "Server URL", "Username" and "Password" properties.

...

Include Page
Include - Plugin Installation
Include - Plugin Installation

Usage

Mandatory Properties

At the project or global level go to Settings > JIRA and set the sonar.jira.urlsonar.jira.login.secured and sonar.jira.password.secured properties.

Note
titleSecurity note for SonarQube 3.4.0 to 3.6.3 included

For the *.secured properties to be read during the project analysis, it is necessary to set the sonar.login and sonar.password properties to the credentials of a user that is both:

  • System administrator
  • And project administrator on the project that is being analyzed
Example:
sonar-runner -Dsonar.login=admin -Dsonar.password=admin

To Display Data on the JIRA Issues Widget

  1. Log in to your JIRA instance and create a filter. Mark it as favorite. You may also want to share this filter with your team.

  2. Specify the sonar.jira.url.param property for the project or module: this is the name of an issue filter that you have previously created on JIRA (check see the JIRA documentation to know for more about on issue filters).

After the next analysis, you can activate the "JIRA Issues" widget for one of your dashboards, and you should see something similar to this:

Image Removed

Link a Sonar review to a JIRA ticket (version >= 1.0 & Sonar >= 3.1)

This feature allows you to create a review (on a violation) that will generate a JIRA ticket on your configured JIRA instance.

In order to get this working, you need:

...

To Create JIRA Issues

Set the sonar.jira.project.key property that is the key of the JIRA project

...

for which this

...

SonarQube plugin will generate tickets

Then, once you're logged in, you should find the "Link to JIRA" action available on any violation:

Image Removed

You can enter any comment and after you press "Link to JIRA", a new review comment is added on the violation: you can see the link to the newly-created JIRA ticket.

Image Removed

And the corresponding JIRA look like:

Image Removed

Usage & Installation

...

Note that you can also configure the issue type, the component, the priorities. Browse the JIRA setting page on the web interface for a complete list.

Note
titleConnecting to JIRA through HTTPS

If you must connect to your JIRA instance through HTTPS, and if a certificate is required for this connection, then you must import the certificate into the CA store of the JRE that runs SonarSonarQube.

FAQ

  • Q: I see the following warning in Sonar SonarQube logs when using the JIRA plugin:

    [WARN] [18:32:24.426] Unable to find required classes (javax.activation.DataHandler and javax.mail.internet.MimeMultipart). Attachment support is disabled.
  • A: This is a message from the Axis SOAP client we are using to talk to your JIRA. You can safely ignore this message. Attachment support is not used anyway.

...

  • Q: I have configured my JIRA instance so that some fields are mandatory. Because Sonar SonarQube does not populate these fields then , issue creation fails. How can I make it work?
  • A: The JIRA "Component" field sonar.jira.issue.component.id property can be defined in Sonar JIRA plugin settings at project level. For other fields the suggested workaround is to create a new issue type in JIRA (for exemple example "Quality issue") and configure JIRA so that all fields are optional for this new issue type. Then configure Sonar JIRA plugin to use this new issue type when creating a new issue.set the sonar.jira.issue.type.id property accordingly.

Change Log

JIRA Issues
anonymoustrue
titleRelease Version 1.12
height70
renderModestatic
width900
columnstype;key;summary;priority
urlhttp://jira.codehaus.org/sr/jira.issueviews:searchrequest-xml/temp/SearchRequest.xml?fixfor=1861219036&pid=11911&sorter/field=priority&sorter/order=DESC&tempMax=1000

 

JIRA Issues
anonymoustrue
JIRA Issues
anonymoustrue
titleRelease 0.3
titleRelease 1.0
height70
renderModestatic
width900
columnstype;key;summary;priority
urlhttp://jira.codehaus.org/sr/jira.issueviews:searchrequest-xml/temp/SearchRequest.xml?jqlQuery=project+%3D+SONARPLUGINS+AND+fixVersion+%3D+%22JIRA-1.0%22+AND+status+%3D+Closed+ORDER+BY+priority+DESC&tempMax=1000

 

Version 1.1
height70
renderModestatic
width900
columnstype;key;summary;priority
urlhttp://jira.codehaus.org/sr/jira.issueviews:searchrequest-xml/temp/SearchRequest.xml?fixfor=1691418612&pid=11911&sorter/field=issuekeypriority&sorter/order=DESC&tempMax=1000

...

JIRA Issues
anonymoustrue
titleRelease 0.2.1
height150
renderModestatic
width900
columnstype;key;summary;priority
urlhttp://jira.codehaus.org/sr/jira.issueviews:searchrequest-xml/temp/SearchRequest.xml?fixfor=16514&pid=11911&sorter/field=issuekey&sorter/order=DESC&tempMax=1000

 

JIRA Issues
anonymoustrue
titleRelease 0.2
height150Version 1.0
height70
renderModestatic
width900
columnstype;key;summary;priority
urlhttp://jira.codehaus.org/sr/jira.issueviews:searchrequest-xml/temp/SearchRequest.xml?fixfor=15613&pid=11911&sorter/field=issuekey&sorter/order=DESC&tempMax=1000

 

JIRA Issues
anonymoustrue
titleRelease 0.1
height150
renderModestatic
width900
columnstype;key;summary;priority
urlhttp://jira.codehaus.org/sr/jira.issueviews:searchrequest-xml/temp/SearchRequest.xml?fixfor=15436&pid=11911&sorter/field=issuekey&sorter/order=jqlQuery=project+%3D+SONARPLUGINS+AND+fixVersion+%3D+%22JIRA-1.0%22+AND+status+%3D+Closed+ORDER+BY+priority+DESC&tempMax=1000