How to integrate JIRA with Robot Framework scripts of pycharm?

2.2k Views Asked by At

I have my automation scripts written in Pycharm using Python-Selenium-Robot Framework. I want to integrate it with JIRA to keep the track of result and other aspects with JIRA issues. Is there any way to achieve it? I checked for XRay plugin but not able to get the detailed tutorial for the configuration. Any suggestions? TIA.

1

There are 1 best solutions below

3
On

If you're using Jira "on-premises" (server/datacenter), then I would advise you to have a look at this tutorial. There's a GitHub repo with the corresponding code. The integration is straighforward: you just need to upload the test results from RF (e.g., output.xml) to a specific endpoint. You can do that with a HTTP POST request (with curl, for example) or from your CI/CD tool, such as Jenkins; for Jenkins, and some other tools, there is a free plugin.

Example of a shell script to upload the results (please adapt it accordingly)

#!/bin/bash

curl -H "Content-Type: multipart/form-data" -u admin:admin -F "[email protected]" "http://192.168.56.102/rest/raven/2.0/import/execution/robot?projectKey=ROB&testPlanKey=ROB-12&testEnvironments=$BROWSER"

There's no special configuration to make in Xray. You just need to upload the test results and that will automatically provision the corresponding Test entities (as Jira issues), and report the results against them. In RF it's possible to do some interesting stuff, like adding tags on the test cases, in case you want to link those tests to some existing Story issue (i.e., cover them), during the import process of the test results.