-2
@Xray(requirement = "QA", test = "TM-3553" ,ProjectName="QA")
@Test()
public void GETGradeForGuestStudent() {

}

why the execution is not getting mapped to TM-3553 Rather its getting mapped always to TM-3601 mapped to jira

my testng report.xml-pastebin.com/iHc4hJmD

In jenkins postbuild action i am calling this sh command

token=$(curl -H "Content-Type: application/json" -X POST --data @"./cloud_auth.json" https://xray.cloud.xpand-it.com/api/v2/authenticate| tr -d '"')
curl -H "Content-Type: application/xml" -X POST -H "Authorization: Bearer $token" --data @"./target/surefire-reports/testng-results.xml" https://xray.cloud.xpand-it.com/api/v2/import/execution/testng?projectKey=TM&testExecKey=TM-3563"
  • 1
    Hi, can you please provide more information as your question is too vague and it is hard for us to help out this way? Are you using Xray on Jira premises or Jira Cloud? Are you using TestNG? Can you share the XML report, to see of the corresponding test element has the TM-3553 key? – Sérgio May 19 '21 at 09:06
  • In jenkins postbuild action i am calling this sh command token=$(curl -H "Content-Type: application/json" -X POST --data @"./cloud_auth.json" https://xray.cloud.xpand-it.com/api/v2/authenticate| tr -d '"') curl -H "Content-Type: application/xml" -X POST -H "Authorization: Bearer $token" --data @"./target/surefire-reports/testng-results.xml" https://xray.cloud.xpand-it.com/api/v2/import/execution/testng?projectKey=TM&testExecKey=TM-3563 – Selenium tester May 19 '21 at 20:13
  • xml- https://pastebin.com/iHc4hJmD – Selenium tester May 19 '21 at 20:18

1 Answers1

0

The TestNG XML report you shared seems to have the correct format, as detailed here. The Test issue key is being mapped to an attribute named "test" under the <attributes> element, which in turn is inside the <test-method> element. I changed your XML report, so that the first reference to TM-3553 is one of my existent Tests ... and it worked fine in my scenario.

Therefore, I think your scenario needs to be analyzed by the Xray team in more depth to figure out exactly why this association is not being done in Xray side. Let me just add that the annotation you shared is not correct, as "requirement" must be an issue key and "ProjectName" doesn't exist/is supported by Xray during the import process.. Therefore, this needs to be changed:

@Xray(requirement = "QA", test = "TM-3553" ,ProjectName="QA")

to something like:

@Xray(requirement = "TM-1243", test = "TM-3553")

Another note about the TestNG XML report, is that it contains several references to the same test method GETGradeForGuestStudent.. which I find weird at first sight but it depends on how you're running the tests.

Sérgio
  • 1,777
  • 2
  • 10
  • 12