Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-52341

JiraTestResultReporter-plugin - API testToIssueMapping doesn't work when Jenkins job exists in sub-folder

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      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:

      1. Create a Jenkins job under some folder say "myfolder/test_job"
      2. Configure post build action with publish JUnit result report and add JiraTestResultReporter step with appropriate values
      3. Optional step, to run the job, let the test fail and tag the Jira ID against the failed test
      4. 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!

        Attachments

          Activity

          Hide
          krupaldesai Krupal Desai added a comment -
          Show
          krupaldesai Krupal Desai added a comment - PR for the fix created:  https://github.com/jenkinsci/JiraTestResultReporter-plugin/pull/12

            People

            Assignee:
            catalinluta Catalin Luta
            Reporter:
            krupaldesai Krupal Desai
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: