This question is about the junit import in the xray test management plugin.
After some automated tests I have a junit result file (from pytest). I'd like to upload the results to xray via its v2 api with python scripts. This works, but I have not yet managed to map specific test cases to their Jira issue counterparts.
When I upload the junit file, the test issues can be created automatically if they don't exist yet, sure. Subsequent uploads are mapped to the same tests but once e.g. the test names change they will be mapped to new test cases in Jira again. Therefore I think it's better to map the tests to their Jira issue key explicitly.
I tried different xml properties and attributes like "testKey" (seems to be used in json format), "test", "issue", "key" etc. in the testcase elements but they are not recognized by xray. The results will always be mapped to the test name.
I haven't tried the json format yet since it would require additional parsing, pytest does not seem to support the xray json format.
Is it possible to map the tests explicitly or is there a better approach?