Linking Test with Test Execution using the Xray Rest API

Deleted user July 17, 2024

Hi,

 

We created the test below API

URL->{{JIRA_BASEURL}}/rest/api/2/issue

Body-->

 

{
   "fields": {
       "project":
       {
          "key": "{{PROJECT_KEY}}"
       },
       "summary": "T1",
       "description": "T1: example of manual test",
       "issuetype": {
          "name": "Test"
       }
   }
}
We were able to create the Test.
Then We created the similar way a Test Execution with the below body
URL->{{JIRA_BASEURL}}/rest/api/2/issue
Body-->{
   "fields": {
       "project":
       {
          "key": "{{PROJECT_KEY}}"
       },
       "summary": "T1",
       "description": "T1: example of Automation test",
       "issuetype": {
          "name": "Test Execution"
       }
   }
}
We were able to create the Test Execution.
Now in our next step, we want to associate a Test Execution with a Test, in which case we are facing a 404 error.
can you please help us.
Pasting the error from the associate end point.
URL->{{JIRA_BASEURL}}/rest/raven/2.0/import/execution
Body-->

 

{
    "info" : {
        "summary" : "Execution of automated tests for release",
        "description" : "This execution is automatically created when importing execution results from an external source",
        "startDate" : "2020-05-30T11:37:00+01:00",
        "finishDate" : "2020-05-30T11:50:00+01:00"
    },
    "tests" : [
        {
            "testKey" : "{{T1_KEY}}",
            "start" : "2020-05-30T11:47:35+01:00",
            "finish" : "2020-05-30T11:49:35+01:00",
            "comment" : "Successful execution1",
            "status" : "PASS"
        }
 ]
}
Result--> 

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<status>
    <status-code>404</status-code>
    <message>null for uri: {{JIRA_BASEURL}}/rest/raven/2.0/import/execution</message>
</status>
Can anyone help.

1 answer

0 votes
Francisco Fonseca _Xray_
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.
July 24, 2024

Hi @[deleted] ,

Have you gone through the documentation: Using Xray JSON format to import execution results 

In case it does not suffice, reach out to our Suppor team through our portal or chat here 

Best, Francisco

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events