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

jira-plugin not working from pipeline job: jiraIssueSelector doesn't find any issues

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Cannot Reproduce
    • Component/s: jira-plugin
    • Labels:
    • Environment:
      Jenkins ver. 2.138.2
      jira-plugin version 3.0.3
    • Similar Issues:

      Description

      jira-plugin works fine from a freestyle job, but is not working properly from a pipeline job.

      I am comparing a freestyle job using the {{"JIRA: Update relevant issues" }}post-build step with a pipeline job using the jiraIssueSelector pipeline step.

      When run on a commit with a commit message of "DEVO-2398 DEVO-2399", the freestyle job correctly gives me the output

      [JIRA] Updating issue DEVO-2399
      [JIRA] Updating issue DEVO-2398

      When I run against the same commit message in the pipeline job, the jiraIssueSelector is not able to identify the Jira items.

      I put the following in my Jenkinsfile:

      {{def issueKeys = jiraIssueSelector(issueSelector: [$class: 'DefaultIssueSelector']) }}

      echo "${issueKeys.size()}"

       and I get the output

       

       [Pipeline] jiraIssueSelector

      [Pipeline] echo

      0

      The jiraIssueSelector is not finding any jiraIssues in the commit message.

      The globally configured "issue pattern" is left blank, so it is left using the default ([a-zA-Z][a-zA-Z0-9_]+-[1-9][0-9]*)([^.]|\.[^0-9]|\.$|$)

        Attachments

          Activity

          portman Porter Bassett created issue -
          Hide
          forster_ch Christoph Forster added a comment -

          Porter Bassett: As you can see in JENKINS-58372 you need to link the "jiraIssueSelector" with the checked out repository.

          def gitScm = git url:  'ssh://git@myhostedbitbucket.com:7999/tools/gittraining.git', branch: 'develop'
          test = jiraIssueSelector(issueSelector: [$class: 'DefaultIssueSelector'], scm: gitScm) 
          println test
          
          Show
          forster_ch Christoph Forster added a comment - Porter Bassett : As you can see in JENKINS-58372 you need to link the "jiraIssueSelector" with the checked out repository. def gitScm = git url: 'ssh: //git@myhostedbitbucket.com:7999/tools/gittraining.git' , branch: 'develop' test = jiraIssueSelector(issueSelector: [$class: 'DefaultIssueSelector' ], scm: gitScm) println test
          warden Radek Antoniuk made changes -
          Field Original Value New Value
          Status Open [ 1 ] Closed [ 6 ]
          Resolution Cannot Reproduce [ 5 ]

            People

            • Assignee:
              Unassigned
              Reporter:
              portman Porter Bassett
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: