How to get issue fields and data correctly from XRAY API cloud v2. Problems with the syntax

Ismael Torres Pareja
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 17, 2023

Hi everyone, its my first post here and my english its not great. 
I hope i can explain my self correctly.

First of all, i have no problem connecting to Xray cloud using Postman. I use client_id and client_secret to get de token for making the requests

 

Then i can get all xray data rellating to test (testPlan, test execution) and i have couples question. 

I see the this official documentation but i dont know if isnt a great documentation or if i dont aundertand correctly.

First question,

When i request all Test vía GraphQL like this:

{
    getTests(jql:"project='abc'",limit: 100) {
        total
        start
        limit
        results {
            issueId
            testType {
                name
                kind
            }
            jira(fields: ["assignee", "reporter"])
        }
    }
}
I know i can get the testPlans data for each Test Case like this
testPlans(limit:10){
total
start
result{
issueId
jira(field:["key"])
}

}
The results of the request it something like this
{
    getTests(limit: 100) {
        total
        start
        limit
        results {
            issueId
            testType {
                name
                kind
            }
testPlans(limit:10){
total
start
result{
issueId
jira(field:["key"])
}

} jira(fields: ["assignee", "reporter"]) } } }
This works fine.
But this is information isnt on the documentation, it seems like this part of the documentation or this other one . But when i tried to fit it up the syntax doesnt seem correct on the GraphQL, it doesnt show anything or it says its a wrong sysntax.
So my first questions it is, where i can found the syntax if i want to extract for example the test executions of a Test Case? or how it fits up the syntax of the documentation (i already put) on the request.
Sorry for the longenss of the question. The second doubt its shorter.
It is possible to get JIRA parameter on this XRAY (cloud) request of the API vía GraphQL?
For example if i want to extract the linkedIssues of a test, how can i do it?
It seems this must be on this part of the results
jira(fields: ["assignee", "reporter"])
But i have tried with -> ["Links"], but doesnt work.
I have tried like this:
jira(fields: ["assignee", "link", "reporter"])
I suspect this Jira fields are on this documentation, but "Links" or "links" does not work.
I dont know if i have explain my self correctly. You can ask any question or doubt.
I would appreciate any help. Thanks for taking your time with this post.

1 comment

Comment

Log in or Sign up to comment
GIORGOS THEOFANOUS
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 20, 2024

I dont know if you solved this problem but at least for the second question the answer is you can fetch the linked issues using the field "issuelinks", also I suspect that if you export a ticket of whatever type as XML you can use the name of the XML elements as fields.

TAGS
AUG Leaders

Atlassian Community Events