Hi Atlassian/Xray community,
We're using Xray Server (not Cloud), and we're building a custom internal tool to manage test executions via API. Here's the context:
I can successfully fetch test executions using:
GET /rest/api/2/search?jql=Project=RTM AND issuetype='Test Execution'
I can fetch the test cases linked to a test execution via:
GET /rest/raven/1.0/api/testexec/{testExecutionKey}/test
I can fetch the testRunId
of each test case using the value from:
issue.fields.customfield_21623[].testRunId
I can update the status of a test run with:
PUT /rest/raven/1.0/api/testrun/{testRunId}
Body: { "status": "PASS" }
✅ This works perfectly and updates in Jira UI.
I'm trying to upload .docx
or .png
files as evidence to a test run using the endpoint:
POST /rest/raven/1.0/api/testrun/{testRunId}/attachments
I get the following error response:
<status>
<status-code>404</status-code>
<message>null for uri: https://mycompanyjira.com/rest/raven/1.0/api/testrun/2572671/attachments</message>
</status>
This happens even though:
The test run ID is valid (verified via /api/test-runs
)
The test run has manual steps (we assume — but not 100% sure)
The evidence files are small and standard (e.g., .docx
, .png
)
To work around the issue, I also attempted using:
POST /rest/raven/1.0/import/execution
With this payload:
{
"testExecutionKey": "RTM-622283",
"tests": [
{
"testKey": "RTM-623929",
"status": "PASS",
"evidences": [
{
"data": "base64encoded",
"filename": "test.docx",
"contentType": "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
}
]
}
]
}
But this also fails silently or does not attach the evidence, even though the status is updated.
Does POST /testrun/{id}/attachments
only work if the test run has manual steps?
Are there any permissions or configurations required on the Jira/Xray side to allow attachments via API?
Should we be using POST /import/execution
for uploading evidence instead — and if so, does it overwrite the execution or merge?
What is the recommended way to programmatically upload evidence to each test case inside a test execution on Xray Server?
Any help or clarification would be greatly appreciated!
Thanks 🙏
— Aryan
Welcome to the community.
Question 1: It seems (documentation based), Yes that this can only be on test with manual test steps. you could reach out to Xray support to get this confirmed.
Related is, I don't seem to find what type of evidence can be attached, might be the docx is not an option.
Question 2: No, this is based on Jira access.
The others I can't answer for you. I hope I could help.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.