-
Bug
-
Resolution: Fixed
-
Major
-
None
-
Jenkins version 2.107.2
JiraTestReporter plugin version 2.0.6
When JiraTestResultReporter plugin API "testToIssueMapping" is called for the Jenkins job residing under a sub-folder, then it is throwing error. It is assuming that the folder is a matrix project and thus failing with below error:
java.lang.ClassCastException: com.cloudbees.hudson.plugins.folder.Folder cannot be cast to hudson.matrix.MatrixProject
{{ at org.jenkinsci.plugins.JiraTestResultReporter.api.TestToIssueMappingApi.doJson(TestToIssueMappingApi.java:49)}}
Full stack trace and logs attached herewith.
Steps to reproduce:
- Create a Jenkins job under some folder say "myfolder/test_job"
- Configure post build action with publish JUnit result report and add JiraTestResultReporter step with appropriate values
- Optional step, to run the job, let the test fail and tag the Jira ID against the failed test
- Call the API URL as "http://<jenkins_url>/plugin/JiraTestResultReporter/testToIssueMapping/api/json?job=myfolder/test_job"
Expected
At step 4, it should return the json with correct Jira mapping for the job
Actual
At step 4, it fails with error as mentioned above and in screenshot
PS: I will be creating a fix for this through a PR and update the link in the comments. Thanks!