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

Jira issue not created when jenkins build failed

    Details

    • Similar Issues:

      Description

      I have setup the 3.0.6 version of Jira plugin for jenkins with my jenkins instance. I am having issue with "Create jira issue" upon job failure. 

      Below is the error i am getting (from Console Output)

       

       Build step 'Execute shell' marked build as failure
       ERROR: Build step failed with exception
       java.lang.NullPointerException
       at hudson.plugins.jira.JiraSession.createIssue(JiraSession.java:413)
       at hudson.plugins.jira.JiraCreateIssueNotifier.createJiraIssue(JiraCreateIssueNotifier.java:202)
       at hudson.plugins.jira.JiraCreateIssueNotifier.currentBuildResultFailure(JiraCreateIssueNotifier.java:357)
       at hudson.plugins.jira.JiraCreateIssueNotifier.perform(JiraCreateIssueNotifier.java:157)
       at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
       at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:741)
       at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690)
       at hudson.model.Build$BuildExecution.post2(Build.java:186)
       at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:635)
       at hudson.model.Run.execute(Run.java:1843)
       at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
       at hudson.model.ResourceController.execute(ResourceController.java:97)
       at hudson.model.Executor.run(Executor.java:429)
       Build step 'JIRA: Create issue' marked build as failure
       Finished: FAILURE

       

       Need urgent help to fixing it.

       

      Regards

      Sachin Gahlawat

        Attachments

          Activity

          Hide
          rfelder Ryan Felder added a comment - - edited

          I am also experiencing this, but it is inconsistent.

          Sometimes I do receive the NullPointerException

          Sometimes a job fails and there is no indication in the logs that anything failed to occur, but a Jira ticket is not created.

          Sometimes tickets are created as expected.

           

          This inconsistent behaviour occurs on projects that have been copied from one another, with no apparent difference in configuration.

          I am presently tweaking issue type and severity values to see if I can get consistent behaviour but have not found a magic combination yet.

           

          I am using Jenkins 2.176.1, Jira Plugin 3.0.8, and I am trying to integrate with a hosted Jira Cloud site.

          Show
          rfelder Ryan Felder added a comment - - edited I am also experiencing this, but it is inconsistent. Sometimes I do receive the NullPointerException Sometimes a job fails and there is no indication in the logs that anything failed to occur, but a Jira ticket is not created. Sometimes tickets are created as expected.   This inconsistent behaviour occurs on projects that have been copied from one another, with no apparent difference in configuration. I am presently tweaking issue type and severity values to see if I can get consistent behaviour but have not found a magic combination yet.   I am using Jenkins 2.176.1, Jira Plugin 3.0.8, and I am trying to integrate with a hosted Jira Cloud site.
          Hide
          tanmoy08 tanmoy roy added a comment -

          Team,

          Any update on this issue.

          Show
          tanmoy08 tanmoy roy added a comment - Team, Any update on this issue.
          Hide
          rfelder Ryan Felder added a comment - - edited

          I just got this today after verifying my Jira settings test reports success.

           

          ERROR: Build step failed with exception
           java.lang.NullPointerException
           at hudson.plugins.jira.JiraCreateIssueNotifier.getStatus(JiraCreateIssueNotifier.java:220)
           at hudson.plugins.jira.JiraCreateIssueNotifier.currentBuildResultSuccess(JiraCreateIssueNotifier.java:388)
           at hudson.plugins.jira.JiraCreateIssueNotifier.perform(JiraCreateIssueNotifier.java:161)
           at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
           at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:741)
           at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690)
           at hudson.model.Build$BuildExecution.post2(Build.java:186)
           at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:635)
           at hudson.model.Run.execute(Run.java:1843)
           at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
           at hudson.model.ResourceController.execute(ResourceController.java:97)
           at hudson.model.Executor.run(Executor.java:429)
           Build step 'JIRA: Create issue' marked build as failure

          Now using Jenkins 2.176.2 and Jira Plugin 3.0.8

          Show
          rfelder Ryan Felder added a comment - - edited I just got this today after verifying my Jira settings test reports success.   ERROR: Build step failed with exception java.lang.NullPointerException at hudson.plugins.jira.JiraCreateIssueNotifier.getStatus(JiraCreateIssueNotifier.java:220) at hudson.plugins.jira.JiraCreateIssueNotifier.currentBuildResultSuccess(JiraCreateIssueNotifier.java:388) at hudson.plugins.jira.JiraCreateIssueNotifier.perform(JiraCreateIssueNotifier.java:161) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:741) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690) at hudson.model.Build$BuildExecution.post2(Build.java:186) at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:635) at hudson.model.Run.execute(Run.java:1843) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:429) Build step 'JIRA: Create issue' marked build as failure Now using Jenkins 2.176.2 and Jira Plugin 3.0.8
          Hide
          devana5 neelima devana added a comment - - edited

           Am  experiencing  the same issue  with null pointer exception, its inconsistent in creating the issues in Jira .

          Work Around:

           Curl command  works fine in create issue in Jira , make sure about your mandatory Jira fields and add them to txt file .

           curl -D- -u username:password -X POST --data-binary "@/<path to TXT file>/abc.txt" -H "Content-Type: application/json" https://*<JIRA_BASEURL>*/rest/api/2/issue/

           

          {

           "fields": {

                 "project":   

          {                        "key": "abc"                 }

          ,

                  "summary": "Sample Test ticket from Jenkins.",

                  "description": "Creating of an issue using project keys and issue type names using the REST API",

                 "issuetype":

          {                        "name": "Task"             }

          ,

               "customfield_10002": 

          {                    "id": "1"                  }

          ,

               "components":[\{"name":"Jenkins"}],

               "assignee" :

          {                  "name" :  "abc"              }

           }

          }

          Show
          devana5 neelima devana added a comment - - edited  Am  experiencing  the same issue  with null pointer exception, its inconsistent in creating the issues in Jira . Work Around:  Curl command  works fine in create issue in Jira , make sure about your mandatory Jira fields and add them to txt file .   curl - D - -u username:password -X POST --data-binary "@/ <path to TXT file> / abc.txt " -H "Content-Type: application/json" https://* <JIRA_BASEURL>*/rest/api/2/issue/   {  "fields": {        "project":    {                        "key": "abc"                 } ,         "summary": "Sample Test ticket from Jenkins.",         "description": "Creating of an issue using project keys and issue type names using the REST API",        "issuetype": {                        "name": "Task"             } ,      "customfield_10002":  {                    "id": "1"                  } ,      "components": [\{"name":"Jenkins"}] ,      "assignee" : {                  "name" :  "abc"              }  } }
          Hide
          rodrigc Craig Rodrigues added a comment -

          Fixed in plugin 3.0.12

          Show
          rodrigc Craig Rodrigues added a comment - Fixed in plugin 3.0.12

            People

            • Assignee:
              Unassigned
              Reporter:
              gahlawat4u Sachin Gahlawat
            • Votes:
              1 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: