I’m trying to retrieve the statuses of test executions using the Jira API, but I’m having trouble. Here’s the process we follow:
1. Run a JQL query to get the parent issues:
(issue in testPlanTestExecutions(TEST-1308798) or issue in testPlanTestExecutions(TEST-1259334)) and (createdDate <= "2024/05/30" and createdDate >= "2024/05/01" )
2. Open one of the parent issues to view the executions.
I’ve attempted to do this, but I can’t seem to get the statuses as shown in the image.
API: /rest/api/latest/search
Request body:
I want to fetch the statuses as a list, rather than one by one. Is this possible?
Community moderators have prevented the ability to post new answers.
you need to get the testRuns object, and the status within it.
Something like this, adapting it to your use case:
query
{
getTestExecutions(jql: "key=CALC-3352", limit: 1) {
results{
issueId
jira(fields: ["key"])
testRuns(limit: 100){
results{
id
status{
name
description
}
comment
testType{
name
kind
}
evidence{
filename
downloadLink
}
defects
executedById
startedOn
finishedOn
assigneeId
unstructured
customFields {
id
name
values
}
test {
issueId
jira(fields: ["key"])
projectId
}
}
}
}
}
}
Where should I run this query in script runner or in database directly?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
this is a graphQL query. You could run this directly or from any API tool like postman.
see the link to documentation below:
https://docs.getxray.app/display/XRAYCLOUD/GraphQL+API
Best
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.