Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • use one of the available CI/CD plugins (e.g. see details of Integration with Jenkins)
  • use the REST API directly (more info here)
    • Code Block
      languagebash
      titleexample of a shell script to export/generate .features from Xray
      collapsetrue
      #!/bin/bash
       
      token=$(curl -H "Content-Type: application/json" -X POST --data @"cloud_auth.json" https://xray.cloud.xpand-itgetxray.comapp/api/v1v2/authenticate| tr -d '"')
      curl -H "Content-Type: application/json" -X GET -H "Authorization: Bearer $token" "https://xray.cloud.xpand-itgetxray.comapp/api/v1v2/export/cucumber?keys=CALC-640;CALC-641" -o features.zip
       
      rm -rf features/*.feature
      unzip -o features.zip -d features
  • ... or even use the UI (e.g. from a Test issue)

...

Code Block
languagebash
titleexample of a Bash script to import results using the standard Cucumber endpoint
collapsetrue
#!/bin/bash
 
BASE_URL=https://xray.cloud.xpand-itgetxray.comapp
token=$(curl -H "Content-Type: application/json" -X POST --data @"cloud_auth.json" "$BASE_URL/api/v1v2/authenticate"| tr -d '"')
curl -H "Content-Type: application/json" -X POST -H "Authorization: Bearer $token"  --data @"merged-test-results.json" "$BASE_URL/api/v1v2/import/execution/cucumber"

...

Code Block
languagebash
titleexample of a shell script to import/synchronize .features to Jira and Xray
collapsetrue
#!/bin/bash
BASE_URL=https://xray.cloud.xpand-itgetxray.comapp
PROJECT=CALC

rm -f features.zip
zip -r features.zip src/test/resources/calculator/ -i \*.feature

token=$(curl -H "Content-Type: application/json" -X POST --data @"cloud_auth.json" "$BASE_URL/api/v1v2/authenticate"| tr -d '"')
curl -H "Content-Type: multipart/form-data" -H "Authorization: Bearer $token"  -F "file=@features.zip" "$BASE_URL/api/v1v2/import/feature?projectKey=$PROJECT"

...

  • use one of the available CI/CD plugins (e.g. see details of Integration with Jenkins)
  • use the REST API directly (more info here)
    • Code Block
      languagebash
      titleexample of a shell script to export/generate .features from Xray
      collapsetrue
      #!/bin/bash
       
      token=$(curl -H "Content-Type: application/json" -X POST --data @"cloud_auth.json" https://xray.cloud.xpand-itgetxray.comapp/api/v1v2/authenticate| tr -d '"')
      curl -H "Content-Type: application/json" -X GET -H "Authorization: Bearer $token" "https://xray.cloud.xpand-itgetxray.comapp/api/v1v2/export/cucumber?keys=CALC-640;CALC-641" -o features.zip
       
      rm -rf features/*.feature
      unzip -o features.zip -d features
  • ... or even use the UI (e.g. from a Test issue)

...

Code Block
languagebash
titleexample of a Bash script to import results using the standard Cucumber endpoint
collapsetrue
#!/bin/bash
 
BASE_URL=https://xray.cloud.xpand-itgetxray.comapp
token=$(curl -H "Content-Type: application/json" -X POST --data @"cloud_auth.json" "$BASE_URL/api/v1v2/authenticate"| tr -d '"')
curl -H "Content-Type: application/json" -X POST -H "Authorization: Bearer $token"  --data @"merged-test-results.json" "$BASE_URL/api/v1v2/import/execution/cucumber"

...