Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Not able to associate test execution with test plan in xray using GraphQL

lalit.kumar
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 22, 2021

I am using below url and body to associate my test execution with test plan but unable to do so.  Both test plan and test execution exist in jira.

URLhttps://xray.cloud.xpand-it.com/api/v2/graphql

Body -

mutation {
    addTestExecutionsToTestPlan(
        issueId"PLAY-306",
        testExecIssueIds["PLAY-304"]
    ) {
        addedTestExecutions
        warning
    }
}
Response
{
    "errors": [
        {
            "message": "{\"errorMessages\":[\"issueId provided is not valid\"],\"errors\":{}}",
            "locations": [
                {
                    "line": 2,
                    "column": 5
                }
            ],
            "path": [
                "addTestExecutionsToTestPlan"
            ]
        }
    ],
    "data": {
        "addTestExecutionsToTestPlan": null
    }
}

 

1 answer

1 accepted

0 votes
Answer accepted
lalit.kumar
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 22, 2021

Got it. Id's are different then keys. I am passing Keys above instead of Id's.

Is there any way to perform the associations based on the Key's.

If not then can we see the id's of test plan on xray UI ?

Rogério Paiva - Xray Xporter
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 14, 2021

Hi @lalit.kumar 

It is necessary first to get the IDs, and you can do it using JQL in the following GraphQL queries: 

getTestExecutions - https://xray.cloud.getxray.app/doc/graphql/gettestexecutions.doc.html

getTestPlans - https://xray.cloud.getxray.app/doc/graphql/gettestplans.doc.html

Thank you.
Kind regards,
Rogério Paiva [Xray Support Team]

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events