1 year ago
#349781
Mahesh Phate
Jira XRAY - Failing to import an xml using xray
I am trying to upload xml to jira using xray api.
for %f in (D:\xray_test_junit\*) do curl -H "Content-Type:text/xml" -X POST -H "Authorization:Bearer %token%" --data @"%f" http://xray.cloud.xpand-it.com/api/v1/import/execution/junit?testExecKey=MYPROJECT-1234
Getting below error:
{"error":"Project Key and Summary are required to create a new Test"}
Note - summary = test case name(not exceeding chars in failed xml) and Key = MYPROJECT-1234
if we split one xml file into multiple (one xml file = one testcase), only one or two xml are not able to upload out of 400 testcases. if we remove starting character (eg. src to rc) or one of character from testcase name(from xml file) xml get uploaded successful but other 399 testcases getting upload with same starting word and number of characters greater than failed testcase xml.
sample result.xml
<?xml version="1.0" encoding="UTF-8"?>
<testsuite tests="2" skips="0" name="pytest" failures="0" errors="0">
<testcase name="src/sampletests//test_descover_user.py/test_get_user_name" time="0.012245601474" line="211" file="tests/test_descover_user.py" classname="tests.test_descover_user.TestGetUsers">
<properties>
<property name="tags" value="AUTOMATED_UT"/>
</properties>
</testcase>
<testcase name="src/sampletests//test_descover_user.py/test_get_user_id" time="0.012245701774" line="211" file="tests/test_descover_user.py" classname="tests.test_descover_user.TestGetUsers">
<properties>
<property name="tags" value="AUTOMATED_UT"/>
</properties>
</testcase>
</testsuite>
anyone can please help me ?
jira
jira-rest-api
jira-xray
0 Answers
Your Answer