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

Ticket creation fails when no components in JIRA project exist / JIRA rejects empty component list

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Trivial
    • Resolution: Fixed
    • jira-plugin

    Description

      Having an issue getting the plugin to create a JIRA ticket. See the configuration screenshots attached for how I've got it setup.

      The error I'm getting is during a failed build is:

      Recording test results
      ERROR: Build step failed with exception
      java.lang.NullPointerException
              at hudson.plugins.jira.JiraSession.createIssue(JiraSession.java:310)
              at hudson.plugins.jira.JiraCreateIssueNotifier.createJiraIssue(JiraCreateIssueNotifier.java:153)
              at hudson.plugins.jira.JiraCreateIssueNotifier.currentBuildResultFailure(JiraCreateIssueNotifier.java:343)
              at hudson.plugins.jira.JiraCreateIssueNotifier.perform(JiraCreateIssueNotifier.java:115)
              at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
              at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
              at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:726)
              at hudson.model.Build$BuildExecution.post2(Build.java:185)
              at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:671)
              at hudson.model.Run.execute(Run.java:1766)
              at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
              at hudson.model.ResourceController.execute(ResourceController.java:98)
              at hudson.model.Executor.run(Executor.java:408)
      Build step 'Create Jira Issue' marked build as failure
      

      If I call our JIRA rest API from the server I can create an issue just fine.

      curl -D- -u username:password -X POST --data @data.txt -H "Content-Type: application/json" https://destinationnsw.atlassian.net/rest/api/2/issue/
      

      data.txt contains:

      {
          "fields": {
             "project":
             {
                "key": "BUGS"
             },
             "summary": "REST ye merry gentlemen.",
             "description": "Creating of an issue using project keys",
             "issuetype": {
                "name": "Bug"
             }
         }
      }
      

      I get "HTTP/1.1 201 Created" and the ticket is available.

      Attachments

        1. build_changelog.png
          build_changelog.png
          35 kB
        2. build_error_message_v141.png
          build_error_message_v141.png
          46 kB
        3. build_error_message_v2.png
          build_error_message_v2.png
          66 kB
        4. create_jira_issue.png
          create_jira_issue.png
          27 kB
        5. global config.png
          global config.png
          52 kB
        6. jira_configuration.png
          jira_configuration.png
          53 kB
        7. project config.png
          project config.png
          91 kB
        8. project config - version 2.png
          project config - version 2.png
          21 kB

        Activity

          People

            warden Radek Antoniuk
            thomwilhelm Thom Wilhelm
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: