Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Image RemovedImage Added

Table of Contents
 

...

Info
titleRequirements

This app was tested against Jenkins v2.32.x and it may not work properly with previous versions. 


Manual Installation


Info
titleDownload the latest version of the Jenkins Plugin

You may download the latest version of the Jenkins plugin from the latest Release Notes.


If you have the actual xray-for-jira-connector.hpi file,

  1. Go to the Update Center of Jenkins in Manage Jenkins > Manage Plugins.
  2. Select the advanced tab
  3. In the Upload Plugin section, click upload and select the file xray-for-jira-connector.hpi file.

...

...

titleDownload the latest version of the Jenkins Plugin

...

You may download the latest version of the Jenkins plugin here: Integration with Jenkins.

Configuration

Xray for Jenkins is configured in the global settings configuration page  Manage Jenkins > Configure System > Xray for Jira configuration.

...

  1. Configuration alias
  2. Server Address: The address of the Jira Server where Xray is running
  3. Authentication:
    1. User: username
    2. Password.

Image RemovedImage Added

Creating a new Project

...

For this app, you should configure a "Freestyle project". In the home page, clicking New Item > Freestyle project, provide a name, and then click OK.

Image RemovedImage Added

Build Steps

Build steps are the building blocks of the build process. These need to be defined in the project configuration.

...

This build step will export the Cucumber Tests (i.e., Scenario/Scenario Outlines) in .feature or bundled in a .zip file. The rules for exporting are defined here.

It invokes Xray's Export Cucumber Tests REST API endpoint (see more information here).

Configuration

Some fields need to be configured in order to export the Cucumber Tests. As input, you can either specify issue keys (see the endpoint documention here) or the ID of the saved filter in Jira.

...

To start the configuration, add the build step Xray: Cucumber Features Export Task.

Image RemovedImage Added

After that, configure it.

In this example, we configured the task to extract the features from a set of issues (PROJ-78 and PROJ-79) to the folder that holds the Cucumber project.

Image RemovedImage Added

Importing the execution results

To start the configuration, add the post-build action Xray: Results Import Task.

Image RemovedImage Added

After that, configure it.

In this example, we configured the task to import the Cucumber JSON results back to Jira.Image Removed

Image Added

Once all configurations are done, click Save at the bottom of the page.

After running the job, the expected result is a new Test Execution issue created in the Jira instance.

Image RemovedImage Added

Importing the execution results with user-defined field values

...

And configured the task to import the Cucumber JSON Multipart results back to Jira.

Image RemovedImage Added

Once all configurations are done, click Save at the bottom of the page.

After running the job, the expected result is a new Test Execution issue created in the Jira instance, with the Test Execution fields as specified in the Jenkins build step configuration.

Image RemovedImage Added

JUnit

Apart from supporting Cucumber natively, Xray enables you to take advantage of many other testing frameworks like JUnit. In this sense, Xray for Jenkins lets you import results in other formats besides Cucumber JSON.

...

To start the configuration, add the post-build action Xray: Results Import Task.

Image RemovedImage Added

After that, configure it.

In this example, we have a configuration where the JUnit XML format is chosen.

Image RemovedImage Added

After running the plan, the expected result is a new Test Execution issue created in the JIRA instance.

Image RemovedImage Added

Troubleshooting

...

When you check the log, it has the following:

Image RemovedImage Added

By default, when you successively try to log into Jira with the wrong credentials, the Jira instance will prompt you to provide a CAPTCHA the next time you try to log in. It is not possible to provide this information via the build process, so it will fail with status code 403 Forbidden.

You will need to log into Jira via the browser and provide the CAPTCHA.

Image RemovedImage Added

If you are a Jira administrator, you can go to Jira administration > User Management and reset the failed login.

Image RemovedImage Added