Hi,
I created a personal workspace on atlassian, added the Xray add-on, and I made a project(MCP) where I added a Test issue (MCP-8) and two Test Executions which include this Test (MCP-9 and MCP-10).
I performed a GET request on the following link in order to get information about the Test issue: https://<my-host-name>.atlassian.net/rest/api/2/issue/MCP-8 . Since there are the two Test Execution linked to this Test, I was expecting to find the Test Executions mentioned in the received JSON.
Do you have any idea how could I get the Test Executions related to a Test, either via REST or maybe JQL query?
Here is the JSON response I got about the Test issue:
{ "expand": "renderedFields,names,schema,operations,editmeta,changelog,versionedRepresentations", "id": "10008", "self": "https://<my-host-name>.atlassian.net/rest/api/2/issue/10008", "key": "MCP-8", "fields": { "statuscategorychangedate": "2020-12-18T09:50:03.027+0200", "issuetype": { "self": "https://<my-host-name>.atlassian.net/rest/api/2/issuetype/10008", "id": "10008", "description": "This is the Xray Test Issue Type. Used to define test cases of different types that can be executed multiple times using Test Execution issues.", "iconUrl": "https://<my-host-name>.atlassian.net/secure/viewavatar?size=medium&avatarId=10551&avatarType=issuetype", "name": "Test", "subtask": false, "avatarId": 10551 }, "timespent": null, "customfield_10030": null, "project": { "self": "https://<my-host-name>.atlassian.net/rest/api/2/project/10001", "id": "10001", "key": "MCP", "name": "My Classic Project", "projectTypeKey": "software", "simplified": false, "avatarUrls": { "48x48": "https://<my-host-name>.atlassian.net/secure/projectavatar?pid=10001&avatarId=10421", "24x24": "https://<my-host-name>.atlassian.net/secure/projectavatar?size=small&s=small&pid=10001&avatarId=10421", "16x16": "https://<my-host-name>.atlassian.net/secure/projectavatar?size=xsmall&s=xsmall&pid=10001&avatarId=10421", "32x32": "https://<my-host-name>.atlassian.net/secure/projectavatar?size=medium&s=medium&pid=10001&avatarId=10421" } }, "customfield_10031": null, "fixVersions": [], "aggregatetimespent": null, "resolution": { "self": "https://<my-host-name>.atlassian.net/rest/api/2/resolution/10000", "id": "10000", "description": "Work has been completed on this issue.", "name": "Done" }, "customfield_10029": null, "resolutiondate": "2020-12-18T09:50:03.019+0200", "workratio": -1, "watches": { "self": "https://<my-host-name>.atlassian.net/rest/api/2/issue/MCP-8/watchers", "watchCount": 1, "isWatching": true }, "issuerestriction": { "issuerestrictions": {}, "shouldDisplay": false }, "lastViewed": "2020-12-17T11:39:50.622+0200", "created": "2020-12-14T13:02:32.598+0200", "customfield_10020": null, "customfield_10021": null, "customfield_10022": null, "customfield_10023": null, "priority": { "self": "https://<my-host-name>.atlassian.net/rest/api/2/priority/3", "iconUrl": "https://<my-host-name>.atlassian.net/images/icons/priorities/medium.svg", "name": "Medium", "id": "3" }, "customfield_10024": null, "customfield_10025": "3_*:*_1_*:*_2187_*|*_10004_*:*_1_*:*_334041729_*|*_10003_*:*_1_*:*_6529_*|*_10005_*:*_1_*:*_0", "labels": [], "customfield_10016": null, "customfield_10017": null, "customfield_10018": { "hasEpicLinkFieldDependency": false, "showField": false, "nonEditableReason": { "reason": "PLUGIN_LICENSE_ERROR", "message": "The Parent Link is only available to Jira Premium users." } }, "customfield_10019": "0|i0001r:", "timeestimate": null, "aggregatetimeoriginalestimate": null, "versions": [], "issuelinks": [], "assignee": null, "updated": "2020-12-18T09:50:03.026+0200", "status": { "self": "https://<my-host-name>.net/rest/api/2/status/10005", "description": "", "iconUrl": "https://<my-host-name>.atlassian.net/", "name": "Done", "id": "10005", "statusCategory": { "self": "https://<my-host-name>.atlassian.net/rest/api/2/statuscategory/3", "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [], "timeoriginalestimate": null, "description": "Given the user exists\r\nWhen the user executes a test case\r\nThen the user fills the test case result", "customfield_10010": null, "customfield_10014": null, "timetracking": {}, "customfield_10015": null, "customfield_10005": null, "customfield_10006": null, "customfield_10007": null, "security": null, "customfield_10008": null, "customfield_10009": null, "attachment": [], "aggregatetimeestimate": null, "summary": "My Edited Test Case Summary", "creator": { "self": "https://<my-host-name>.atlassian.net/rest/api/2/user?accountId=5fd73252849d640111623d4e", "accountId": "5fd73252849d640111623d4e", "emailAddress": "<my-email-address@email.com>", "avatarUrls": { "48x48": "https://secure.gravatar.com/avatar/fddebe93606710ee03899d4c78667fcb?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FBS-0.png", "24x24": "https://secure.gravatar.com/avatar/fddebe93606710ee03899d4c78667fcb?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FBS-0.png", "16x16": "https://secure.gravatar.com/avatar/fddebe93606710ee03899d4c78667fcb?d=https%3A%2F%2Favatar-management--avatars...<my-host-name>.atlassian.net/rest/api/2/user?accountId=5fd73252849d640111623d4e", "accountId": "5fd73252849d640111623d4e", "emailAddress": "<my-email-address@email.com>", "avatarUrls": { "48x48": "https://secure.gravatar.com/avatar/fddebe93606710ee03899d4c78667fcb?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FBS-0.png", "24x24": "https://secure.gravatar.com/avatar/fddebe93606710ee03899d4c78667fcb?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FBS-0.png", "16x16": "https://secure.gravatar.com/avatar/fddebe93606710ee03899d4c78667fcb?d=https%3A%2F%2Favatar-management--avatars...<my-host-name>.atlassian.net/rest/api/2/issue/MCP-8/votes", "votes": 0, "hasVoted": false }, "comment": { "comments": [], "maxResults": 0, "total": 0, "startAt": 0 }, "worklog": { "startAt": 0, "maxResults": 20, "total": 0, "worklogs": [] } }}
Hi,
You need to use the Xray API for this, not JIRA's API, since these two tests are now "Test Runs" in Xray terms. Depending on if you use Xray Cloud or Server:
To use GraphQL, here is the query I would use to retrieve those test runs:
query { getTestExecution(issueId: "YOUR_TEST_EXECUTION_ID"){ tests(limit: 100){ results { issueId } } } }
This query can be used as the json data for your POST request to Xray's GraphQL.
Hope this helps!
Mee too, is facing a similar issue/error. Can someone assist on this.
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.