Possible to get test key from junit test name?

Linking based on the test name seems extremely brittle to me: Change the name of a class and now your test associations are broken.

I can see that when using X-RAY's custom JSON format, or NUnit, you're able to associate an automated test with a Test Key in JIRA.

Is there no way to use this with JUnit XML files? To me it seems like these should both be associated with the hypothetical test "PRJ-123":

// example xray-output.json
"tests": [
"testKey": "PRJ-123",
"start": "2013-05-03T11:47:35+01:00",
"finish": "2013-05-03T11:50:56+01:00",
"comment": "Test was OK but the performance is very poor",
"status": "PASS"
// example junit.xml
<?xml version="1.0" encoding="UTF-8"?>
<testsuites name="Mocha Tests" time="0.026000000000000002" tests="2" failures="1">
<testsuite name="some feature" timestamp="2017-11-30T20:28:42" tests="2" file="/a/b/c.js" failures="1" time="0.026000000000000002">
<testcase name="some feature [PRJ-123] does a thing" time="0.02" classname="[PRJ-123] does a thing">


1 answer

Hi Mike Wyatt,


Thank you for your suggestion. We do not have this kind of solution due to JUnit 4 lack of labels elements. Your suggestion is valid but not clean and clear enough. We do have a story to use JUnit 5 capabilities to perform what you intend, https://jira.xpand-addons.com/browse/XRAY-1243. Please "watch" and "vote" for it.


Best regards,

Xpand Add-ons Team

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Bridget Sauer
Published Thursday in Marketplace Apps

Calling all developers––You're invited to Atlas Camp 2018

 Atlas Camp   is our developer event which will take place in Barcelona, Spain  from the 6th -7th of   September . This is a great opportunity to meet other developers and get n...

78 views 0 5
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you