0

I'm importing Java Cucumber test executions using the REST endpoint:

/rest/raven/1.0/import/execution/cucumber

I want to add the "Test environment" where this test was executed.

Is this possible for Cucumber test executions? The documentation refers to "testEnvironments" for Xray JSON format, but I don't see it for Cucumber JSON output format.

Sérgio
  • 13
  • 1
  • 3

1 Answers1

0

For cucumber, you have to use the multipart endpoint as the standard one that you referred doesn't provide that ability (the team aims to improve that in the future). You should look at this documentation

Example:

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

Where you would use the following createTestExec.json to specify the fields of the Test Execution. You need to find the custom field id of the "Test Environments" custom field in your Jira administration.

{
    "fields": {
        "project": {
            "key": "XRAY"
        },
        "summary": "Test Execution for cucumber Execution",
        "issuetype": {
            "id": "10009"
        },
        "customfield_10030" : [
            "iOS"
        ]
    }
}
Sérgio
  • 1,777
  • 2
  • 10
  • 12