Jenkins Integration

Zephyr for Jira is now Zephyr Squad! Read more about this.

Zephyr for Jira is now Zephyr Squad! Read more about this.

About integration

Integration with Jenkins means that you can create and update automation tasks from your Jenkins job, and send test results to Zephyr for Jira from these jobs.

To do this, you use script code that sends API requests to Zephyr for Jira. This page explains how you can call this script from a Jenkins job.

Requirements

  • To configure Jenkins jobs and settings, you need to have Administrator permissions for your Jenkins instance.

  • The Jenkins nodes, where the integration code will run, should have access to Internet and your Jira project.

Integration Steps

1. Prepare sample script

You can either write the integration script from scratch, but we’d recommend editing an example script.
You can find it as well as information on the changes to be done in the following topic:

Integration Script Explained

Make sure to replace constants in this script – access key, user ids, project keys, result file name, and others – with the data relevant to your Zephyr project.

2. Configure your Jenkins instance

The integration script should run after the build and automated tests are over, typically, at the end of the job execution. To run the script at this point, you need to install a special plugin into your Jenkins instance:

  1. Log in to Jenkins as an administrator.

  2. Click Manage Jenkins on the left and then click Manage Plugins:

    Configuring Jenkins - Opening the list of plugins

    3. On the next page, switch to the Available tab, find the PostBuildScript Plugin in it and install that plugin.
    (The plugin enables you to run scripts as part of post-build actions):

    Installing the plugin

    4. Restart Jenkins, if needed.

3. Configure the job

After you install the plugin, you can configure the job:

  1. In Jenkins, on the main screen, click your job and select Configure in the menu on the left:

     

  2. Go to Post-build Actions.
    The script should run after the build and automated tests are over.

     

  3. Click Add post-build action and select Execute scripts from the menu (this item is added by the PostBuildScript plugin). This will append the Execute Script actions to your Jenkins job.

     

  4. Click Add generic script file:

     

  5. In the action properties, in the Generic script file path box, enter the name of your script file. Configure other parameters like run conditions or the node for the run:

     

  6. Save the changes.

Now, if you run your job, it will connect to Zephyr for Jira, create (or update) an automation task in it and attach test results to this task.

 

See Also

Continuous Integration

Integration Script Explained

Bamboo Integration

Â