Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Can't import test execution results with custom fields using Xray Json REST API

Oleg Shtilerman
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 9, 2024

I am attempting to import a list of test case execution results to a JIRA project using the Xray REST API.

 Using the Xray JSON format I have successfully uploaded execution results for existing tests without Custom Fields info. Unfortunately I have not been able to upload results with Custom fields. 

 The JSON used for the successful upload attempt is:

{'info': {'testPlanKey': 'LQ-1651',

  'description': 'Start time: 2024-06-09T10:16:28+0000\nFinish time: 2024-06-09T10:16:46+0000',

  'summary': 'Regression summary: dev: Passed 2 from 3',

  'version': '',

  'startDate': '2024-06-09T10:16:28+0000',

  'finishDate': '2024-06-09T10:16:46+0000'},

 'tests': [{'testKey': 'LQ-1474', 'status': 'PASSED'},

  {'testKey': 'LQ-1475', 'status': 'PASSED'}]}

 

Json #1 with  Custom Fields info:

{'info': {'testPlanKey': 'LQ-1651',

  'description': 'Start time: 2024-06-09T10:16:28+0000\nFinish time: 2024-06-09T10:16:46+0000',

  'summary': 'Regression summary: dev: Passed 2 from 3',

  'version': '',

  'startDate': '2024-06-09T10:16:28+0000',

  'finishDate': '2024-06-09T10:16:46+0000'},

 'tests': [{'testKey': 'LQ-1474',

   'status': 'PASSED',

   'customFields': [{'id': '11723', 'value': ['Local']}]},

  {'testKey': 'LQ-1475', 'status': 'PASSED'}]}

Resonse text is: "error":"Errors processing custom fields of Test 1: Invalid custom field with id 11723."

 

Another version:

{'info': {'testPlanKey': 'LQ-1651',

  'description': 'Start time: 2024-06-09T10:16:28+0000\nFinish time: 2024-06-09T10:16:46+0000',

  'summary': 'Regression summary: dev: Passed 2 from 3',

  'version': '',

  'startDate': '2024-06-09T10:16:28+0000',

  'finishDate': '2024-06-09T10:16:46+0000'},

 'tests': [{'testKey': 'LQ-1474',

   'status': 'PASSED',

   'customFields': [{'id': 11723, 'value': ['Local']}]},

  {'testKey': 'LQ-1475', 'status': 'PASSED'}]}

Response text: {"error":"Result is not valid Xray Format"}

1 answer

Suggest an answer

Log in or Sign up to 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.
June 25, 2024

Hi @Oleg Shtilerman , 

Welcome to the Community.

 

I would suggest you contact our Support through this Portal. They can assist you with this.

 

Still, the errors you mention suggest you are not using the correct Xray JSON format. Do you want to take a look at this article from our documentation:  

https://docs.getxray.app/display/XRAYCLOUD/Using+Xray+JSON+format+to+import+execution+results#UsingXrayJSONformattoimportexecutionresults-customfield 

 

Best

Francisco - Xblend

DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events