You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am running into an issue calling jiraIssueSelector using the plugin inside a Jenkinsfile for a pipeline build. The plugin works as expected with a Freestyle job, but I get nothing inside a pipeline. Here's my basic Jenkinsfile, sanitized:
When I run the job, here is what I get in the build console output:
Started by user me
Running in Durability level: MAX_SURVIVABILITY
[Pipeline] Start of Pipeline
[Pipeline] node
Running on Jenkins in /var/lib/jenkins/jobs/DEV/jobs/pipelinetest/workspace
[Pipeline] {
[Pipeline] stage
[Pipeline] { (checkout)
[Pipeline] deleteDir
[Pipeline] checkout
The recommended git tool is: NONE
using credential uuid for Bitbucket
Cloning the remote Git repository
Cloning repository https://bitbucket.myserver.net/scm/code/api.git
> git init /var/lib/jenkins/jobs/DEV/jobs/pipelinetest/workspace # timeout=10
Fetching upstream changes from https://bitbucket.myserver.net/scm/code/api.git
> git --version # timeout=10
> git --version # 'git version 1.9.1'
using GIT_ASKPASS to set credentials me login
> git fetch --tags --progress https://bitbucket.myserver.net/scm/code/api.git +refs/heads/*:refs/remotes/api/* # timeout=10
> git config remote.directory.url https://bitbucket.myserver.net/scm/code/api.git # timeout=10
> git config --add remote.api.fetch +refs/heads/*:refs/remotes/api/* # timeout=10
Avoid second fetch
> git rev-parse refs/remotes/api/unstable^{commit} # timeout=10
Checking out Revision 238b4ca42 (refs/remotes/api/unstable)
> git config core.sparsecheckout # timeout=10
> git checkout -f 38b4ca42 # timeout=10
Commit message: "Testing jenkins integration XXX-1234"
> git rev-list --no-walk 38b4ca42 # timeout=10
Posting build status of INPROGRESS to MSI Bitbucket for commit id [38b4ca42] and ref 'null'
[Pipeline] jiraIssueSelector
[Pipeline] jiraIssueSelector
[Pipeline] echo
Here are the issue IDs:
[Pipeline] echo
[]
[Pipeline] echo
[]
[Pipeline] echo
0
[Pipeline] echo
0
[Pipeline] sh
+ git log -1 --oneline
[Pipeline] echo
189cf9e Testing jenkins integration XXX-1234
[Pipeline] echo
43
[Pipeline] sh
+ git log -1 --pretty=oneline
+ sort -u
+ grep -e [A-Z]\+-[0-9]\+ -o
[Pipeline] echo
XXX-1234
[Pipeline] echo
8
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
Posting build status of SUCCESSFUL to MSI Bitbucket for commit id [38b4ca42] and ref 'null'
Finished: SUCCESS
Expected result:
That the jiraIssueSelector will get the Jira issue from the commit message.
Actual result:
When it runs, it appears that jiraIssueSelector is not finding anything, or doesn't have access to the build output. I tried calling the class two different ways, as shown in the script. I also added an alternate method to run a script for git log to get the latest commit and use regex to get the Jira issue, and it appears to work.
When I look at the examples, they reference passing in an SCM parameter to the jiraIssueSelector, but that appears to be deprecated.
Any info or tips on what I might be doing wrong?
The text was updated successfully, but these errors were encountered:
Env details:
Jenkins version 2.289.3
Jira Plugin version v3.5
OS: Ubuntu 18.04
I am running into an issue calling jiraIssueSelector using the plugin inside a Jenkinsfile for a pipeline build. The plugin works as expected with a Freestyle job, but I get nothing inside a pipeline. Here's my basic Jenkinsfile, sanitized:
Reproduction steps
Results
When I run the job, here is what I get in the build console output:
Expected result:
That the jiraIssueSelector will get the Jira issue from the commit message.
Actual result:
When it runs, it appears that jiraIssueSelector is not finding anything, or doesn't have access to the build output. I tried calling the class two different ways, as shown in the script. I also added an alternate method to run a script for git log to get the latest commit and use regex to get the Jira issue, and it appears to work.
When I look at the examples, they reference passing in an SCM parameter to the jiraIssueSelector, but that appears to be deprecated.
Any info or tips on what I might be doing wrong?
The text was updated successfully, but these errors were encountered: