For Xray on Jira server/datacenter ... Need authentication token to push the results from jenkins pipeline ... How to generate the token or if there is any other way to authenticate and push the test results
1 Answers
In Jira server/datacenter, usually the authentication is done using a Jira's user credentials (i.e., username and password). It's also possible to use Personal Access Tokens (in Jira datacenter only), but this is not that common; besides, these Personal Access tokens are totally unrelated with the authentication tokens used in Xray cloud in case you've seen that.
So, and first of all, you need to install the Xray Jenkins connector/plugin. Then you need to configure a Xray instance, where you specify the server URL and the credentials (i.e., Jira username + password). Then you can either use the UI to setup your build , on a freestyle project for example, and use the task "Xray: Results Import Task" as a build step. If you're using declarative pipelines, on a pipeline type of project, then you can generate the pipeline syntax as follows:
Access Jenkins' Snippet Generator to faciliate the process of generating the pipeline script code. You may access it, from the pipeline syntax link available from within your project.
Then select "step: General build step", "Xray: Results Import Task" and fill out the values you want.. it will then allow you to generate the script that you can include in your pipeline.
If you don't want to use the Xray Jenkins connector/plugin, you could also invoke the Xray REST API directly and perform a HTTP POST request to submit the test report, using the Jira user credentials and basic authentication. This could be achieved by invoking, for example, "curl" utility as a build step.

- 1,777
- 2
- 10
- 12