import cucumber Json in Xray Jira [error: Error assembling issue data: project is required]

Hari Venkadesh August 23, 2024

Hello there,

 I'm trying to import cucumber json to Jira (X-ray), but I'm facing few difficulties. I've included the specifics below.

 

I have tried two api's of both 1.0 and 2.0 versions, according to below documentation
https://docs.getxray.app/display/XRAY30/Import+Execution+Results+-+REST#ImportExecutionResultsREST-CucumberJSONresultsMultipart

https://docs.getxray.app/display/XRAY/Import+Execution+Results+-+REST

 

curl --request POST \ --url https://jira.xxxxx.com/rest/raven/2.0/import/execution/cucumber?testExecKey=IRx67017-7090\ --header 'Authorization: Bearer OTc5MjY1MTYyMDM4OhLblTGVdp44xxxxx'

POST /rest/raven/2.0/import/execution/cucumber/multipart?testExecKey=IRX67017-8462 HTTP/1.1 Authorization: Bearer OTc5MjY1MTYyMDM4OhLblTGVdp445xBbKMNxxxxxxJ Content-Type: multipart/form-data; boundary=--011000010111000001101001 Host: jira.dt.renault.com Content-Length: 405 -----011000010111000001101001 Content-Disposition: form-data; name="result" C:\Users\z040609\Downloads\bdd_report-master\bdd_report-master\POC\POC\cucumber-json\LockStatus.json -----011000010111000001101001 Content-Disposition: form-data; name="info" C:\Users\z040609\Downloads\bdd_report-master\bdd_report-master\POC\POC\cucumber-json\testExecutionInfo2.json -----011000010111000001101001-
 
I'm receiving this response"error": "Error assembling issue data: project is required" while hitting above api's. 

info:
{ "fields": { "project": { "id": "IRX67017" }, "summary": "Test Execution for cucumber Execution", "issuetype": { "id": "10212" } } }

https://jira.xxxxx.com/rest/raven/2.0/import/execution/cucumber?testExecKey=IRN67017-7090

//jira.xxxxx.com/rest/raven/2.0/import/execution/cucumber?

//jira.xxxxx.com/rest/raven/2.0/import/execution/cucumber?

?testExecKey=IRx67017-7090

https://

1 answer

0 votes
Manuel
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 19, 2024

The problem may be because you're not following one of the two supported flows for Cucumber as detailed here. You cannot simply import results; you test results need to contain references to *existing* Test issues corresponding to each Scenario you have in your cucumber side.

Usually what this means is that you need first to have the Test issues created in Xray side (one per each Scenario), then you need to export them. This will generate a Cucumber .feature file with your scenarios tagged with the original Test issue keys.

Whenever you run the tests on your CI pipeline, that report will contain references to the Test issues in Xray, allowing Xray to understand that results should be mapped to them.

Xray never creates Test issues whenever importing test automation results from Cucumber (or similar frameworks).

 

Xray will infer the target Jira project based on those issue keys, whenever you're using the standard Cucumber JSON endpoint for importing test results.

 

Please check this tutorial for Java which details the 2 flows.

 

Note: I've provided Xray Cloud documentation but the principles are the same if you are using Xray on-prem.

 

 

 

Suggest an answer

Log in or Sign up to answer