Reputation: 11
I'm trying to implement an Automation Rule for Xray Test Executions in Jira Cloud.
To do this, I send a GraphQL request at one point, where I get a lot of test executions.
POST
Custom Data
{"query": "{getTestExecutions(jql: \"project = ‘ABC’ and status = 'XYZ'\", limit: 100) {results {issueId}}}"}
Then I continue working with the IDs obtained in this way.
My problem is that the jql query returns more than 100 results. Unfortunately, the oldest results are always returned first. However, I am interested in the latest results. This means that usually only for test executions that have been created/modified within the last seven days. How can I get the latest IDs? I've thought of one of these possibilities, but I don't know if/how to implement it:
Thank you in advance. Oliver
Upvotes: 0
Views: 30
Reputation: 2129
You can address this need in 2 ways:
a) using the modifiedSince
argument on the GraphQL call, as you mentioned. This date should be in the format: YYYY-MM-DDTHH:mm:ssZ. So you need to build that reference date in some step before on Jira automation.
As a side note, this will correspond to making a GraphQL call like
query
{
getTestExecutions(jql: "project = CALC", limit: 10, modifiedSince: "2025-01-10T00:00:00Z") {
results{
issueId
jira(fields: ["key"])
}
}
}
b) or on the JQL, using a query to consider the "updated" date; note that this won't take into account changes made on the related Test Runs, just on the Test Executions issues themselves.. so a) above is more clean.
project = CALC and issuetype = "Test Execution" and updated > -30days
Upvotes: 0