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:
Log in to Jenkins as an administrator.
Click Manage Jenkins on the left and then click Manage 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):
4. Restart Jenkins, if needed.
3. Configure the job
After you install the plugin, you can configure the job:
In Jenkins, on the main screen, click your job and select Configure in the menu on the left:
Go to Post-build Actions. The script should run after the build and automated tests are over.
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.
Click Add generic script file:
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:
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.