Why is description field mandatory for xray generic tests

Kevin Malley June 4, 2021

I am attempting to pass a JUNIT XML test result to xray using 

curl -H "Content-Type: text/xml" -X POST -H "Authorization: Bearer $token"  --data @"data.xml" https://xray.cloud.xpand-it.com/api/v1/import/execution/junit?projectKey=XTP

 

This should create a "generic test" result however I am receiving an error due to the description field being mandatory.  {"error":"Error creating Test Execution - Description is required."}

 

How can this be avoided.  Can the description field be non mandatory for the generic test type only or do I need to send a multipart request?

1 answer

1 vote
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.
June 24, 2021

Hi @Kevin Malley 

The error refers to the issue Description, which must be mandatory in your project.

So you have two options here, make the field Description optional in your project or use the multipart REST API to provide a description.

When you import a JUnit XML, it will create new Test Executions, which are based on Jira Issues. So if your project requires that the Description of issues is mandatory, Xray cannot create a Test Execution issue without a Description. So either you make it optional or you use the multipart REST API to send the Description text to be used when creating the issue (Test Execution).

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