Child pages
  • JiraTestResultReporter-plugin
Skip to end of metadata
Go to start of metadata

Plugin Information

View JiraTestResultReporter on the plugin site for more information.

Creates issues in Jira for failed unit tests.

2.x Versions

WARNING: 2.x versions of this plugin are not compatible with the previous 1.x versions. What this means is that your configurations related to this plugin will not be imported from previous versions when you do an upgrade.

For details about previous versions usage and configuration, please see the 1.x Versions section.

What it does

This plugin allows you to create and/or link issues from Jira to failed tests in Jenkins. The creation/linking is done directly in the Jenkins interface. For the creation of the issues you can supply a template for what is going to be added in most of the issue's fields.

Global Configuration

Before doing anything else, the global configurations must be done. In order to do these go to Manage Jenkins -> Configure System -> JiraTestResultReporter and enter here the JIRA server url the username and password. It is highly recommended that you click the Validate Settings button every time you make any changes here. Also from here you can configure the global templates for Summary and Description, by clicking on the Advanced button. These templates will be used to create issues if they are not overridden in the job configuration.

Use a dedicated Jira user

From a security and usage perspective, it's recommended to create a dedicated Jira user for the reporting.

Job Configuration

The first thing we need to do here is enabling the plugin:

  • Freestyle projects and Multi-configuration projects
    First, JUnit test reports need to be enabled by going to Add post-build action -> Publish JUnit test report. Then check the box next to JiraTestResultReporter in the Additional test report features section.
  • Maven Project
    Add post-build action -> Additional test report features -> check the box next to JiraTestResultReporter.

Configuration:

Insert the Project key in the respective field. Again, highly recommended to push the Validate Settings.

After setting the project key the Issue type select will be populated with the available issue types for that specific project.

If you check the Auto raise issue check box, this plugin will create and link issues for all the failing tests in new builds that don't already have linked issues.

Checking Auto resolve issue check box will enable an experimental feature. Basically, if you had a test that was failing and you had a linked Jira issue to it, the plugin will try to resolve your issue. What this means is that it will look for available transitions from the current state and it will try to find one that in the name has the word "resolve". If such a transition is found it will apply it, otherwise it will just log a message. In future releases this will be configurable.

Only after configuring the fields above, if you want you can override the Summary and Description values by clicking theAdvanced button. If you want, here you can configure all available fields for that specific issue type. Due to Jenkins interface development limitations, you have to search for the desired field from the four available types of fields, after clicking the Add Field Configuration.

Important: Do not leave empty values for fields, if you didn't find the desired field in the current chosen option, delete it before trying the next one.

Finally, I cannot say that this is recommended ( although it is (smile) ), read the help tag for the Validate Fields and if the warning there is not a problem for you click the button.

Usage

After building the project, go to the test results page. Next to the test cases you will see a blue plus button, next to a No issue message. If you want to create an issue, or link an existing one, click the blue plus button and choose the desired option. For unlinking an issue, click the red x button.

When creating, linking and unlinking issues, you it is recommended that wait for the page to reload, before doing something else for another test. Errors will be shown inline, if any.

Finally, your issues are created and you can see them by clicking the links directly from the Jenkins interface.

Variables

For text fields in the Job Configuration and Global Confinguration (Summary and Description only) you can use variables that will expand to the appropriate value when the issue is created in JIRA. You can use all the environment variables defined by Jenkins (see link). Additionaly, this plugin can expand a set of predefined variables that expose information about the test.

Integrations

TestNG

TestNG will automatically generate JUnit test reports that can be found by default in <project-folder>/test-output/junitreports. Unfortunately, you cannot use the published results by the Jenkins TestNG plugin with our plugin. In order to use the link functionality you must configure a JUnit publisher (Post Build Actions -> Publish JUnit test result report) as follows:

xUnit

You can use the functionality of the JiraTestResultReporter with all the testing standards that are supported by the xUnit plugin (see their wiki page for supported formats). The workflow would be as follows:

  1. Run your testing tool that creates result files in a testing standard
  2. Configure the xUnit plugin to convert said testing standard into JUnit
  3. Configure the JUnit publisher (Post Build Actions -> Publish JUnit test result report)
  4. Enable Additional test report features and configure JiraTestResultRepoter as explained in the Job Configuration section above

JSON API endpoint

You can view the test to issue mappings in JSON format by sending a request to the following url: http://my.jenkins.com/plugin/JiraTestResultReporter/testToIssueMapping/api/json?job=$JobName. For Freestyle and Maven jobs you simply query the url:  http://my.jenkins.com/plugin/JiraTestResultReporter/testToIssueMapping/api/json?job=MyJob. For Matrix Projects sending a request as before will return you a JSON with mappings for all axis and if you want a specific axis you do as following: http://my.jenkins.com/plugin/JiraTestResultReporter/testToIssueMapping/api/json?job=MyJob/MyAxisName=MyAxisValue. It is recommended that you use url encoded characters.

1.x Versions

What it does

This plugin examines the build job for failed unit tests. It work by using the Jenkins internal test result management for detecting failed tests. Just let Jenkins run and report your unit tests e.g. by adding the “Publish xUnit test results report” to your build job.

If JiraTestResultReporter detects new failed tests, it will create an issue for every test case in Jira:

Usage

  • In the build job add JiraTestResultReporter as a post-build action.
  • Configure the plugin for this job. See the help boxes for details.
  • Build your job. If there are failed tests, the plugin will create issues for them. This will (should!) happen only once for every new failed tests; new in this case means tests that have an age of exactly 1.

Use a dedicated Jira user

From a security and usage perspective, it's recommended to create a dedicated Jira user for the reporting. This helps to identify (e.g. filter) issues created by the plugin.

Version history

Version

     Changes                                                      

2.0.5

- JENKINS-47645 - java.lang.NoSuchMethodError on "Configure System" page / unable to edit configuration

- JENKINS-44691 - Correlates a new test failure with a resolved jira issue

2.0.4

- JENKINS-40520 - Breaks Save button on Manage Jenkins/Configure System
- JENKINS-39813 - [Doc] Add steps to integrate TestNG and xUnit
- JENKINS-22405 - Error if the job has no testresults

2.0.3

- enable view of the linked issue even if the test passes
- added API endpoint to view the test to issue mapping
- added job configuration field that allows jira user fields

2.0.2

- fix configuration issue (JENKINS-34904)
- added more logging
- issue summary is now shown as tooltip when hovering over issue link

2.0.1

- fix packaging issue (JENKINS-34806)
- fix UI bugs due to Jenkins changes

2.0.0

- the plugin was rewritten entirely

1.0.4

- new: validate config settings
- new: option to create issues for old issues (to catch up on a project with unreported issues)

1.0.3

- fixed an issue that prevented storing of the configuration (Sorry!)

1.0.2

- first version

26 Comments

  1. Hi, i use jira onDemand, and i don't have succes. When I ejecute the build, in the log file appear this:

    may 10, 2013 9:27:24 AM hudson.model.AbstractBuild$AbstractBuildExecution performAllBuildSteps
    WARNING: Publisher JiraTestResultReporter.JiraReporter aborted due to exception
    java.lang.NullPointerException
    at JiraTestResultReporter.JiraReporter.perform(JiraReporter.java:106)
    at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
    at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:804)
    at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:776)
    at hudson.model.Build$BuildExecution.post2(Build.java:183)
    at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:726)
    at hudson.model.Run.execute(Run.java:1600)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
    at hudson.model.ResourceController.execute(ResourceController.java:88)
    at hudson.model.Executor.run(Executor.java:241)

    thanks

    1. Jonathan,

      thanks for bringing this up. I don't have access to an OnDemand instance of Jira, but I'll try to find out, what the issue could be.

      Best regards,

      Stephan.

      1. Hi Stephan,

        JiraReporter.java:106 corresponds to testResultAction.getFailedTests();
        testResultAction is a null object because build.getTestResultAction(); didn't return anything.

        I have the same problem. I was wondering why junit build results are not returned.

        I am not using JiraOnDemand, its privately hosted.

        Thanks for your help!

  2. I have a large qty of testNG integration tests that I would like to track in JIRA, but only in some circumstances. Occasionally there is a lab problem and these integration level tests might all fail, and I wouldn't want JIRA issues for all of them. Can this plugin be configured to (or is there a different plugin for) allow me to create a JIRA issue manually (by clicking on a certain link for a failed test)?
    This obviously wouldn't be fully automatic, but would save me a ton of clicking around in JIRA. In other words it would allow me to pick and choose which ones to create issues for, and then it would create them when I clicked the appropriate link.

    1. Hi!

      Thanks for the suggestion. I'll make up my mind, what can be done for your requirement.

      Best regards,

      Stephan.

  3. Hello,

    I've stumble upon a problem running fresh unmofified Atlassian JIRA v6.0.3#6099

    I've tried the plugin agaist the company's Jira installation but I've got the same error.

    It seems that the REST request in mailformed (status: 400)

    JiraTestResultReporter DEBUG Creating issue in project AUTOMATION at URL http://localhost:9000/rest/api/2/issue/

    JiraTestResultReporter INFO Reporting issue.
    JiraTestResultReporter DEBUG statusLine: HTTP/1.1 400 Bad Request

    JiraTestResultReporter DEBUG statusCode: 400

    ERROR: Publisher JiraTestResultReporter.JiraReporter aborted due to exception
    java.lang.RuntimeException: JiraTestResultReporter ERROR Failed : HTTP error code : 400
    at JiraTestResultReporter.JiraReporter.createJiraIssue(JiraReporter.java:188)
    at JiraTestResultReporter.JiraReporter.perform(JiraReporter.java:108)
    at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
    at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:804)
    at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:776)
    at hudson.model.Build$BuildExecution.post2(Build.java:183)
    at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:726)
    at hudson.model.Run.execute(Run.java:1618)
    at hudson.matrix.MatrixRun.run(MatrixRun.java:146)
    at hudson.model.ResourceController.execute(ResourceController.java:88)
    at hudson.model.Executor.run(Executor.java:247)
    Finished: FAILURE

    I suggest it's because of incompatiblity between the some of the request fields and the Jira ones.JiraTestResultReporter

    JiraTestResultReporter

    JiraTestResultReporter

    [JiraTestResultReporter] [DEBUG] ----------------------------
    [JiraTestResultReporter] [DEBUG] projectKey: AUTOMATION
    [JiraTestResultReporter] [DEBUG] errorDetails: No alert is present (WARNING: The server did not provide any stacktrace information)
    Command duration or timeout: 2.63 seconds
    Build info: version: '2.32.0', revision: '6c40c187d01409a5dc3b7f8251859150c8af0bcb', time: '2013-04-09 10:39:28'
    System info: os.name: 'Windows Server 2008 R2', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_17'
    Session ID: e97ecf43-52a8-40ed-ac0e-aeec6d4a6a8e
    Driver info: org.openqa.selenium.firefox.FirefoxDriver
    Capabilities

    Unknown macro: {platform=XP, databaseEnabled=true, cssSelectorsEnabled=true, javascriptEnabled=true, acceptSslCerts=true, handlesAlerts=true, browserName=firefox, browserConnectionEnabled=true, nativeEvents=true, webStorageEnabled=true, rotatable=false, locationContextEnabled=true, applicationCacheEnabled=true, takesScreenshot=true, version=17.0.6}

    [JiraTestResultReporter] [DEBUG] fullName: backoffice.autoreferrals.DuplicateBetPlacedThatHadTimedOutWhileWaitingForCustomerAcceptanceTest.testDuplicateBetPlacedThatHadTimedOutWhileWaitingForCustomerAcceptance
    [JiraTestResultReporter] [DEBUG] simpleName: DuplicateBetPlacedThatHadTimedOutWhileWaitingForCustomerAcceptanceTest
    [JiraTestResultReporter] [DEBUG] title: Case Result: testDuplicateBetPlacedThatHadTimedOutWhileWaitingForCustomerAcceptance
    [JiraTestResultReporter] [DEBUG] packageName: backoffice.autoreferrals
    [JiraTestResultReporter] [DEBUG] name: testDuplicateBetPlacedThatHadTimedOutWhileWaitingForCustomerAcceptance
    [JiraTestResultReporter] [DEBUG] className: backoffice.autoreferrals.DuplicateBetPlacedThatHadTimedOutWhileWaitingForCustomerAcceptanceTest
    [JiraTestResultReporter] [DEBUG] failedSince: 31
    [JiraTestResultReporter] [DEBUG] status: FAILED
    [JiraTestResultReporter] [DEBUG] age: 1
    [JiraTestResultReporter] [DEBUG] ErrorStackTrace: org.openqa.selenium.NoAlertPresentException: No alert is present (WARNING: The server did not provide any stacktrace information)
    Command duration or timeout: 2.63 seconds
    Build info: version: '2.32.0', revision: '6c40c187d01409a5dc3b7f8251859150c8af0bcb', time: '2013-04-09 10:39:28'
    System info: os.name: 'Windows Server 2008 R2', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_17'
    Session ID: e97ecf43-52a8-40ed-ac0e-aeec6d4a6a8e
    Driver info: org.openqa.selenium.firefox.FirefoxDriver
    Capabilities

    platform=XP, databaseEnabled=true, cssSelectorsEnabled=true, javascriptEnabled=true, acceptSslCerts=true, handlesAlerts=true, browserName=firefox, browserConnectionEnabled=true, nativeEvents=true, webStorageEnabled=true, rotatable=false, locationContextEnabled=true, applicationCacheEnabled=true, takesScreenshot=true, version=17.0.6}at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
    at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:187)
    at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:145)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:554)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:569)
    at org.openqa.selenium.remote.RemoteWebDriver$RemoteTargetLocator.alert(RemoteWebDriver.java:848)
    at EventMarket.modifyPricingMaxBet(EventMarket.java:87)
    at DuplicateBetPlacedThatHadTimedOutWhileWaitingForCustomerAcceptanceTest.testDuplicateBetPlacedThatHadTimedOutWhileWaitingForCustomerAcceptance(DuplicateBetPlacedThatHadTimedOutWhileWaitingForCustomerAcceptanceTest.java:96)

  4. I am trying the plugin and it works without errors, but it says it published the report but I cannot find it anywhere on my JIRA instance.

    I configured it with a project key "TEST" which exists, and I have the build parametrized as well with a JIRA issue, but don't know where it is publishing this report. Can you help?

    ** EDIT **

    I found out that the URL was wrong, the port number was wrong, So there is one bug for you.

    When I corrected it I got a http 404 error

    This is the output

     [JiraTestResultReporter] [DEBUG] ----------------------------
    [JiraTestResultReporter] [DEBUG] Creating issue in project TEST at URL http://10.0.0.34:8080/rest/api/2/issue/
    
    [JiraTestResultReporter] [INFO] Reporting issue.
    [JiraTestResultReporter] [DEBUG] statusLine: HTTP/1.1 404 Not Found
    
    [JiraTestResultReporter] [DEBUG] statusCode: 404
    
    ERROR: Publisher JiraTestResultReporter.JiraReporter aborted due to exception
    java.lang.RuntimeException: [JiraTestResultReporter] [ERROR] Failed : HTTP error code : 404
    	at JiraTestResultReporter.JiraReporter.createJiraIssue(JiraReporter.java:188)
    	at JiraTestResultReporter.JiraReporter.perform(JiraReporter.java:108)
    	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
    	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:785)
    	at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:757)
    	at hudson.model.Build$BuildExecution.post2(Build.java:183)
    	at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:706)
    	at hudson.model.Run.execute(Run.java:1703)
    	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
    	at hudson.model.ResourceController.execute(ResourceController.java:88)
    	at hudson.model.Executor.run(Executor.java:231)
    
  5. I checked out the source code from github and build successfully. I installed the plugin but when I add it to my job it does not show the text boxes.

    On clicking "save" I get this error

     javax.servlet.ServletException: java.lang.RuntimeException: Failed to instantiate class JiraTestResultReporter.JiraReporter from {"stapler-class":"JiraTestResultReporter.JiraReporter","kind":"JiraTestResultReporter.JiraReporter"}
    	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:778)
    	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:858)
    	at org.kohsuke.stapler.MetaClass$6.doDispatch(MetaClass.java:248)
    	at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
    	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:728)
    	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:858)
    	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:631)
    	at org.kohsuke.stapler.Stapler.service(Stapler.java:225)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
    	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:686)
    	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1494)
    	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:96)
    	at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:88)
    	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1482)
    	at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:85)
    	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1482)
    	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
    	at hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51)
    	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    	at jenkins.security.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:117)
    	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    	at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
    	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    	at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142)
    	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    	at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)
    	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    	at org.acegisecurity.ui.basicauth.BasicProcessingFilter.doFilter(BasicProcessingFilter.java:174)
    	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    	at jenkins.security.ApiTokenFilter.doFilter(ApiTokenFilter.java:64)
    	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    	at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
    	at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:67)
    	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    	at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76)
    	at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:164)
    	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1482)
    	at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:46)
    	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1482)
    	at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:81)
    	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1474)
    	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:499)
    	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
    	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:533)
    	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
    	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)
    	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:428)
    	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
    	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)
    	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
    	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
    	at org.eclipse.jetty.server.Server.handle(Server.java:370)
    	at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:489)
    	at org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:960)
    	at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:1021)
    	at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:865)
    	at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240)
    	at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
    	at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:668)
    	at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
    	at winstone.BoundedExecutorService$1.run(BoundedExecutorService.java:77)
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    	at java.lang.Thread.run(Unknown Source)
    Caused by: java.lang.RuntimeException: Failed to instantiate class JiraTestResultReporter.JiraReporter from {"stapler-class":"JiraTestResultReporter.JiraReporter","kind":"JiraTestResultReporter.JiraReporter"}
    	at hudson.model.Descriptor.newInstance(Descriptor.java:576)
    	at hudson.model.Descriptor.newInstancesFromHeteroList(Descriptor.java:914)
    	at hudson.model.Descriptor.newInstancesFromHeteroList(Descriptor.java:899)
    	at hudson.util.DescribableList.rebuildHetero(DescribableList.java:203)
    	at hudson.model.Project.submit(Project.java:208)
    	at hudson.model.Job.doConfigSubmit(Job.java:1137)
    	at hudson.model.AbstractProject.doConfigSubmit(AbstractProject.java:791)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    	at java.lang.reflect.Method.invoke(Unknown Source)
    	at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:298)
    	at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:161)
    	at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:96)
    	at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:120)
    	at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
    	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:728)
    	... 63 more
    Caused by: java.lang.NullPointerException
    	at JiraTestResultReporter.JiraReporter.<init>(JiraReporter.java:64)
    	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    	at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    	at java.lang.reflect.Constructor.newInstance(Unknown Source)
    	at org.kohsuke.stapler.RequestImpl.invokeConstructor(RequestImpl.java:447)
    	at org.kohsuke.stapler.RequestImpl.instantiate(RequestImpl.java:690)
    	at org.kohsuke.stapler.RequestImpl.access$100(RequestImpl.java:81)
    	at org.kohsuke.stapler.RequestImpl$TypePair.convertJSON(RequestImpl.java:587)
    	at org.kohsuke.stapler.RequestImpl.bindJSON(RequestImpl.java:400)
    	at org.kohsuke.stapler.RequestImpl.bindJSON(RequestImpl.java:396)
    	at hudson.model.Descriptor.newInstance(Descriptor.java:567)
    	... 79 more
    
  6. Is it possible to customize issue creation:

    • set component
    • set fix version
    • set affected version
    • set priority
    • etc

    I think it will be really useful

  7. Hi, I receive the following log. Can you help me? Thank you.
    Recording NUnit tests results
    JiraTestResultReporter INFO Examining test results...
    JiraTestResultReporter INFO Reporting issue.
    ERROR: Publisher JiraTestResultReporter.JiraReporter aborted due to exception
    java.lang.RuntimeException: JiraTestResultReporter ERROR Failed : HTTP error code : 400
    at JiraTestResultReporter.JiraReporter.createJiraIssue(JiraReporter.java:188)
    at JiraTestResultReporter.JiraReporter.perform(JiraReporter.java:108)
    at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
    at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:784)
    at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:756)
    at hudson.model.Build$BuildExecution.post2(Build.java:183)
    at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:705)
    at hudson.model.Run.execute(Run.java:1695)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
    at hudson.model.ResourceController.execute(ResourceController.java:88)
    at hudson.model.Executor.run(Executor.java:231)

    1. Hi ,

      were you able to solve this issue??

  8. Hi,

    Is there a way we can assign it to the user who checked in the files last. we use perforce for SCM .. jenkins and Jira. So whenever someone checkin's files the CI will build and run the tests. if some test fail. we want a Jira issue to be created and assigned to the user who checked in the files. Is there a way we can use this plugin along with creating a jira issue assign it to the user.

    Thanks,

    Kiran

  9. I tried using your plugin by locally installed JIRA and enabled remote API setting as instructed, I was able to post an issue in JIRA after which my JIRA crashed and I had to re-install the JIRA after then the plugin stopped working. The build is failing due to the JIRA result publisher. Please find the console log of the failed Jenkins build below. Any sort help or information is appreciated

    JIRA Version: v6.3.4#6332

    Jenkins Version: 1.577

    ERROR: Publisher JiraTestResultReporter.JiraReporter aborted due to exception
    java.lang.NoSuchMethodError: hudson.model.AbstractBuild.getTestResultAction()Lhudson/tasks/test/AbstractTestResultAction;
    at JiraTestResultReporter.JiraReporter.perform(JiraReporter.java:105)
    at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
    at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:770)
    at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:734)
    at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModuleSetBuild.java:1040)
    at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:683)
    at hudson.model.Run.execute(Run.java:1765)
    at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:529)
    at hudson.model.ResourceController.execute(ResourceController.java:89)
    at hudson.model.Executor.run(Executor.java:240)
    Finished: FAILURE

    1. Hi!

      I'm sorry, but with Jenkins version 1.577 a substantial change has been made to the underlying JUnit. This obviously broke some plugins - not only this one.

      I'll have to look into this, but this will take some time. As a workaround: Jenkins versions prior to 1.577 should still work with JiraTestResultReporter.

      1. Thanks for promptly responding on to this. I tried downgrading the Jenkins to 1.518 and I am still facing the issue. Please find the log below. 

        [JiraTestResultReporter] [INFO] Examining test results...
        ERROR: Publisher JiraTestResultReporter.JiraReporter aborted due to exception
        java.lang.NullPointerException
        at JiraTestResultReporter.JiraReporter.perform(JiraReporter.java:106)
        at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
        at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:804)
        at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:776)
        at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModuleSetBuild.java:960)
        at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:726)
        at hudson.model.Run.execute(Run.java:1601)
        at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:486)
        at hudson.model.ResourceController.execute(ResourceController.java:88)
        at hudson.model.Executor.run(Executor.java:241)
        Finished: FAILURE

  10. Hi
    I am trying with this plugin but getting some other error like     [JiraTestResultReporter] [DEBUG] ----------------------------java.lang.RuntimeException: java.lang.RuntimeException: org.json.JSONException: A JSONArray text must start with '[' at 1 [character 2 line 1][JiraTestResultReporter] [INFO] Done.Finished: SUCCESSthe issue is not updating to my JIRA my configurations1. jenkins version 1.598 (this is my master server on ubuntu)2.  created windows slave machine (2008 R2 server)3.     running my testcases in the slave machine, which is a windows batch file (automated testcase with Selenium webdriver and TestNG).4.  run this batch file in build step as windows batch file5.  in post build step configured xUnit( version 1.96) plugin and selected jUnit and gave the output file from the build step.6. again configured post build step with JiraTestResultReporter (version 1.0.5-SNAPSHOT-Here) plugin for pushing the failed test case into my JIRA server.in step 6 I am facing issue.
    HiCapture.PNG
    I am trying with this plugin but getting some other error like 
        
    [JiraTestResultReporter] [DEBUG] ----------------------------
    java.lang.RuntimeException: java.lang.RuntimeException: org.json.JSONException: A JSONArray text must start with '[' at 1 [character 2 line 1]
    [JiraTestResultReporter] [INFO] Done.
    Finished: SUCCESS
    the issue is not updating to my JIRA 
    my configurations with Jenkins
    1. jenkins version 1.598 (this is my master server on ubuntu)
    2. created windows slave machine (2008 R2 server)
    3.     running my testcases in the slave machine, which is a windows batch file (automated testcase with Selenium webdriver and TestNG).
    4. run this batch file in build step as windows batch file
    5. in post build step configured xUnit( version 1.96) plugin and selected jUnit and gave the output file from the build step.
    6. again configured post build step with JiraTestResultReporter (version 1.0.5-SNAPSHOT-Here) plugin for pushing the failed test case into my JIRA server.
    in step 6 I am facing issue.
     My configuration with Jira
    1.  created a JIRA free trail account.
    2. created a project in JIRA.
    my errorlist
    Started by user anonymous
    Building remotely on testSelenium in workspace C:\SeleniumTest\workspace\testwithJira
    [xUnit] [INFO] - Starting to record.
    [xUnit] [INFO] - Processing JUnit
    [xUnit] [INFO] - [JUnit] - 1 test report file(s) were found with the pattern '**/TEST-CallingTestSuite.xml' relative to 'C:\SeleniumTest\workspace\testwithJira' for the testing framework 'JUnit'.
    [xUnit] [INFO] - Converting 'C:\SeleniumTest\workspace\testwithJira\test-output\junitreports\TEST-CallingTestSuite.xml' .
    [xUnit] [INFO] - Check 'Failed Tests' threshold.
    [xUnit] [INFO] - Check 'Skipped Tests' threshold.
    [xUnit] [INFO] - Setting the build status to SUCCESS
    [xUnit] [INFO] - Stopping recording.
    [JiraTestResultReporter] [INFO] Examining test results...
    [JiraTestResultReporter] [DEBUG] Build result is SUCCESS
    [JiraTestResultReporter] [DEBUG] [JiraTestResultReporter] [INFO] Workspace is C:\SeleniumTest\workspace\testwithJira
    [JiraTestResultReporter] [DEBUG] projectKey: TEST
    [JiraTestResultReporter] [DEBUG] errorDetails: test failure
    [JiraTestResultReporter] [DEBUG] fullName: callSuiteForFirefox.errorcreating
    [JiraTestResultReporter] [DEBUG] simpleName: callSuiteForFirefox
    [JiraTestResultReporter] [DEBUG] title: Case Result: errorcreating
    [JiraTestResultReporter] [DEBUG] packageName: (root)
    [JiraTestResultReporter] [DEBUG] name: errorcreating
    [JiraTestResultReporter] [DEBUG] className: callSuiteForFirefox
    [JiraTestResultReporter] [DEBUG] failedSince: 102
    [JiraTestResultReporter] [DEBUG] status: FAILED
    [JiraTestResultReporter] [DEBUG] age: 1
    [JiraTestResultReporter] [DEBUG] ErrorStackTrace: creation failed
    [JiraTestResultReporter] [DEBUG] affectedFile: creation failed
    [JiraTestResultReporter] [DEBUG] ----------------------------
    java.lang.RuntimeException: java.lang.RuntimeException: org.json.JSONException: A JSONArray text must start with '[' at 1 [character 2 line 1]
    java.lang.RuntimeException: java.lang.RuntimeException: org.json.JSONException: A JSONArray text must start with '[' at 1 [character 2 line 1]
    [JiraTestResultReporter] [INFO] Done.
    Finished: SUCCESS
    and this is my generated xml file for the test case 
    <?xml version="1.0" encoding="UTF-8"?>
    <!-- Generated by org.testng.reporters.JUnitReportReporter -->
    <testsuite hostname="WIN-8FAO3TGLGAQ" name="CallingTestSuite" tests="2" failures="1" timestamp="26 Jun 2015 05:03:57 GMT" time="33.829" errors="0">
      <testcase name="callSuiteForFirefox" time="33.829" classname="CallingTestSuite"/>
       <testcase classname="callSuiteForFirefox" name="errorcreating" time="0.006">
             <failure message="test failure">creation failed</failure>
          </testcase>
    </testsuite> <!-- CallingTestSuite -->

    • Is there any format do I need to follow for xml file?
    • which test I need to select from xUnit plugin for selenium testcase(webdriver+TestNg) output
  11. Do we have support for this plugin ?

    if yes , can I use this for Automated test failures (I mean selenium)

    Please let me know. 

    1. Hello!

      Unfortunately, right now the plugin only works with JUnit tests. We are discussing adopting other tests as well, like TestNG. Please open a request in JIRA so we can track the discussion and let you know if we can commit to it or not.

  12. Is there a way I can assign the created Jira ticket to a user as well?

  13. Is there a way I can assign the created Jira ticket to a user as well?

    1. Hello Anhad, 

      The functionality of adding default assignees has been added in the latest version (2.0.3). Please bare in mind that you should use the username when adding this entry.

      Regards,

      Catalin 

  14. I have a scenario. Please let me know whether this is possible or not. If there are failure test cases in a build, then with the JiraTestResultReporter plugin used, jenkins is creating an issue in JIRA. When I go to JIRA, and change the status of the created issue to resolved and close the issue, and run the build again in Jenkins which has the same failure test case, then it is not creating the issue again in JIRA. So, is this possible to create the same issue again which is resolved and closed in JIRA.

    1. Hey, Rohit!

      First off, please let us know what version of the plugin you are using. In the 2.x versions, unlinkage is done manually. So, if you've closed a JIRA issue, you should also unlink in from the Jenkins view. A new issue will be created only when the failing test has no issue linked to it.

  15. We have been using the JiraTestResultReporter plugin in our system. We added few custom fields in our JIRA and we could not see those fields in Jenkins. It seems the plugin has cached the JIRA values and it is trying to load from there. Is there any way to clear this plugin cache to ensure the latest values are loaded. I also tried to remove the configuration values and re-added them but still its the old values.
    I installed a vanilla jenkins and adding this plugin loads the changed values but as this is a common jenkins used across the board need your suggestion on how to circumvent this.


    Update : After restarting Jenkins I was able to get the new fields/changes loaded.

    Thanks for all the help !!!

  16. Is this Plugin Supported in Pipeline? I'm unable to Generate Pipieline Script! with 2 fixes I was able to generate this : 

    step([$class: 'JUnitResultArchiver', testDataPublishers: [<object of type org.jenkinsci.plugins.JiraTestResultReporter.JiraTestDataPublisher>], testResults: 'MyTest/*xml']) 

    Anybody used this for Pipeline?