Uploaded image for project: 'Xray for Jira'
  1. Xray for Jira
  2. XRAY-997

As a user, when importing execution results with the Xray JSON format, it should be possible to include any JIRA fields just like the JIRA REST API, by using a multipart endpoint

    XporterXMLWordPrintable

Details

    • Story
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • R3.2.0
    • Core, Integration
    • Xray R3.2.0 S3, Xray R3.2.0 S1, Xray R3.2.0 S2
    • NOTRUN

    Description

      When importing execution results with the Xray REST API and the Xray JSON format, it should be possible to define any JIRA field to create/update the corresponding Test Execution issue.

      For this, a new multipart endpoint shall be provided for Xray JSON. One of the parts contains the JSON content corresponding to the test runs; the other part contains the info JSON content, related with the fields of the Test Execution. The later follows the syntax of JIRA REST api for updating/creating issues.

       

       

      POST /rest/raven/1.0/import/execution/multipart

       

      Content of Xray JSON  part: 

      {
          "tests" : [
              {
                  "testKey" : "DEMO-6",
                  "start" : "2014-08-30T11:47:35+01:00",
                  "finish" : "2014-08-30T11:50:56+01:00",
                  "comment" : "Successful execution",
                  "status" : "PASS"
              },
              {
                  "testKey" : "DEMO-7",
                  "start" : "2014-08-30T11:51:00+01:00",
                  "finish" : "2014-08-30T11:52:30+01:00",
                  "comment" : "Execution failed. Example #5 FAIL.",
                  "status" : "FAIL",
                  "evidences" : [
                      {
                          "data": "iVBORw0KGgoAAAANSUhEUgAABkIAAAO9CAYAAADezXv6AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAAEn(...base64 file enconding)",
                          "filename": "image21.jpg",
                          "contentType": "image/jpeg"
                      }
                  ],
                  "examples" : [
                      "PASS",
                      "PASS",
                      "PASS",
                      "PASS",
                      "FAIL"
                  ],
                  "steps": [
                      {
                          "status": "PASS",
                          "comment": "Coment on Test Step Result 1",
                          "evidences" : [
                              {
                                  "data": "iVBORw0KGgoAAAANSUhEUgAABkIAAAO9CAYAAADezXv6AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAAEn(...base64 file enconding)",
                                  "filename": "image22.jpg",
                                  "contentType": "image/jpeg"
                              }
                          ]
                      }
                  ],
                  "defects" : [
                          "DEMO-10",
                          "DEMO-11"
                 ]
              }
          ]
      }

       

       Content of info JSON part, with the fields to be set in the Test Execution: 

      {
          "fields": {
              "project": {
                  "id": "10402"
              },
              "summary": "My Test Execution",
              "issuetype": {
                  "id": "10007"
              },
              "components" : [
                  {
                  "name":"Interface"
                  },
                  {
                  "name":"Core"
                  }
              ]
          }
      }

       

       

      curl -u admin:admin -F info=@createTestExec.json -F result=@results.json http://yourserver/rest/raven/1.0/import/execution/multipart

       

       

      Attachments

        Activity

          People

            pmmr Pedro Rodrigues
            bmpc Bruno Conde
            Votes:
            6 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 1 week
                1w
                Remaining:
                Time Spent - 1 day, 1 hour Remaining Estimate - 3 days, 7 hours
                3d 7h
                Logged:
                Time Spent - 1 day, 1 hour Remaining Estimate - 3 days, 7 hours
                1d 1h