I’m having trouble with the Jira Xray API. I’ve used the /rest/raven/2.0/import/execution/cucumber/multipart endpoint to create a test execution, but the cucumber test cases aren’t being linked to it.
I’ve tried both the API and manual import, but no luck. The test execution is created, but it’s empty. I’m not sure what I’m doing wrong.
Here’s a simplified version of what I’m sending:
{
"fields": {
"project": {"key": "PROJ1"},
"summary": "Cucumber Test Run",
"description": "API test run",
"issuetype": {"id": "10001"}
}
}
I’ve encountered a similar issue before with Jira Xray. The problem might be in how you’re structuring your API request. Make sure you’re using the correct Content-Type headers for each part of your multipart request. The JSON payload should have ‘application/json’, and the Cucumber file should be ‘application/json’ or ‘text/plain’ depending on your file format.
Also, double-check that your Cucumber JSON is valid and follows the expected structure. Sometimes, minor formatting issues can cause the import to fail silently. You might want to try validating your JSON using a tool like JSONLint.
If these don’t help, I’d recommend enabling debug logging in Xray if possible. This can provide more detailed error messages that aren’t always visible in the UI or API response. Lastly, ensure your Jira user has the necessary permissions to create and modify test executions in the project.
hey, have u checked ur xray version? older ones can be finicky w/ cucumber imports. also, make sure ur json is properly formatted - even a small typo can mess things up. if u’ve got access, try checking the xray logs for any errors. they might give u more info on whats goin wrong. good luck!
Having dealt with Xray integration myself, I can relate to your frustration. One thing that’s not immediately obvious is that Xray expects a specific format for the cucumber JSON. Make sure your feature file has a ‘keyword’ field (like ‘Feature:’) and each scenario has a ‘type’ field (usually ‘scenario’).
Also, check if your Jira project has the Xray app properly configured. Sometimes, permissions or incorrect setup can cause silent failures. If possible, try running a manual import through the Xray UI with the same JSON file. This often provides more detailed error messages.
Lastly, if you’re using any custom fields in your test execution, ensure they’re included in the JSON payload. Xray can be picky about required fields, even if they’re not obvious.
If none of this helps, I’d recommend reaching out to Xray support. They’ve been quite responsive in my experience and might be able to spot something in your specific setup.