jenkinsci/git-changelog-plugin

Not connecting to Jira to pull issue details

Closed this issue · 4 comments

Version report

Jenkins and plugins versions report:

Jenkins: 2.277.4
OS: Linux - 5.4.0-1047-aws
---
matrix-auth:2.6.7
workflow-support:3.8
envinject-api:1.7
workflow-api:2.45
ssh-slaves:1.31.5
font-awesome-api:5.15.3-3
javadoc:1.6
jaxb:2.3.0.1
pipeline-stage-tags-metadata:1.8.5
lockable-resources:2.11
bootstrap5-api:5.0.1-2
ace-editor:1.1
pipeline-stage-step:2.5
categorized-view:1.12
okhttp-api:3.14.9
checks-api:1.7.0
pipeline-model-extensions:1.8.5
popper-api:1.16.1-2
workflow-aggregator:2.6
conditional-buildstep:1.4.1
jjwt-api:0.11.2-9.c8b45b8bb173
email-ext:2.83
jsch:0.1.55.2
code-coverage-api:1.3.2
snakeyaml-api:1.29.1
resource-disposer:0.16
ssh:2.6.1
cobertura:1.16
blueocean-pipeline-api-impl:1.24.7
htmlpublisher:1.25
script-security:1.77
blueocean-dashboard:1.24.7
pipeline-milestone-step:1.3.2
maven-repo-cleaner:1.2
github:1.33.1
durable-task:1.37
blueocean-pipeline-scm-api:1.24.7
bootstrap4-api:4.6.0-3
zap:1.1.0
blueocean-pipeline-editor:1.24.7
echarts-api:5.1.2-2
nexus-artifact-uploader:2.13
groovy:2.4
jquery:1.12.4-1
blueocean-git-pipeline:1.24.7
blueocean:1.24.7
pipeline-stage-view:2.19
build-blocker-plugin:1.7.7
blueocean-autofavorite:1.2.4
blueocean-web:1.24.7
plain-credentials:1.7
mask-passwords:3.0
custom-tools-plugin:0.8
junit:1.50
groovy-postbuild:2.5
rebuild:1.32
xvfb:1.1.3
blueocean-core-js:1.24.7
handy-uri-templates-2-api:2.1.8-1.0
blueocean-jwt:1.24.7
ansicolor:1.0.0
caffeine-api:2.9.1-23.v51c4e2c879c8
blueocean-rest-impl:1.24.7
github-branch-source:2.10.4
ssh-agent:1.22
throttle-concurrents:2.3
config-file-provider:3.8.0
blueocean-display-url:2.4.1
trilead-api:1.0.13
envinject:2.4.0
blueocean-commons:1.24.7
badge:1.8
blueocean-rest:1.24.7
branch-api:2.6.4
workflow-scm-step:2.12
variant:1.4
jacoco:3.2.0
metrics:4.0.2.8
scm-api:2.6.4
cloudbees-bitbucket-branch-source:2.9.9
blueocean-config:1.24.7
cloudbees-folder:6.15
pipeline-rest-api:2.19
popper2-api:2.5.4-2
git-changelog:3.9
blueocean-bitbucket-pipeline:1.24.7
workflow-step-api:2.23
command-launcher:1.6
aws-java-sdk:1.11.995
pubsub-light:1.16
pipeline-model-api:1.8.5
pipeline-utility-steps:2.8.0
blueocean-personalization:1.24.7
workflow-cps-global-lib:2.19
build-timeout:1.20
slack:2.48
flexible-publish:0.16.1
text-finder:1.16
pipeline-build-step:2.13
plugin-util-api:2.3.0
workflow-multibranch:2.24
workflow-durable-task-step:2.39
token-macro:2.15
antisamy-markup-formatter:2.1
build-name-setter:2.2.0
apache-httpcomponents-client-4-api:4.5.13-1.0
git-server:1.9
description-setter:1.10
dropdown-viewstabbar-plugin:1.7
display-url-api:2.3.5
windows-slaves:1.8
extended-choice-parameter:0.82
urltrigger:0.49
git:4.7.2
credentials-binding:1.25
workflow-basic-steps:2.23
momentjs:1.1.1
jobConfigHistory:2.27
blueocean-i18n:1.24.7
pipeline-model-definition:1.8.5
view-job-filters:2.3
blueocean-github-pipeline:1.24.7
aws-credentials:1.29
jenkins-design-language:1.24.7
job-dsl:1.77
build-pipeline-plugin:1.5.8
pipeline-input-step:2.12
credentials:2.5
nodejs:1.4.0
jquery3-api:3.6.0-1
git-client:3.7.2
pipeline-graph-analysis:1.11
github-api:1.123
maven-plugin:3.12
timestamper:1.13
blueocean-events:1.24.7
performance:3.19
handlebars:3.0.8
testng-plugin:1.15
extended-read-permission:3.2
configuration-as-code:1.51
bouncycastle-api:2.20
validating-string-parameter:2.8
jackson2-api:2.12.3
modernstatus:1.3
sse-gateway:1.24
workflow-job:2.41
ec2:1.61
structs:1.23
node-iterator-api:1.5.0
favorite:2.3.3
swarm:3.27
sonar:2.13.1
run-condition:1.5
build-monitor-plugin:1.12+build.201809061734
matrix-project:1.18
ws-cleanup:0.39
mailer:1.34
authentication-tokens:1.4
workflow-cps:2.92
parameterized-trigger:2.41
log-parser:2.1
ssh-credentials:1.18.1
jdk-tool:1.5
  • What Operating System are you using (both controller, and any agents involved in the problem)?
Ubuntu 18.04

Reproduction steps

Jenkins pipeline script

                            // checkout the repo
                            checkout changelog: false, poll: false, scm: [
                                    $class           : 'GitSCM',
                                    branches         : [[name: '*/development']],
                                    extensions       : [],
                                    userRemoteConfigs: [
                                            [credentialsId: 'bitbucket-ssh', url: "git@bitbucket.org:__redact__/${repo}.git"]
                                    ]
                            ]

                            // find the latest semantic version tag
                            def latestTag = sh(returnStdout: true, script: "git tag --sort=-creatordate | grep -P '^\\d+\\.\\d+\\.\\d+\$' | head -n 1").trim()
                            echo "Latest version tag for ${repo} is ${latestTag}"

                            // check for changes
                            def headRevision = sh(returnStdout: true, script: "git rev-parse HEAD").trim()
                            def tagRevision =  sh(returnStdout: true, script: "git rev-parse ${latestTag}").trim()

                            changeLog += "Changes for ${repo} since last release (${latestTag}):"
                            def repoChanges
                            if (headRevision == tagRevision) {
                                repoChanges = "No changes"
                            } else {
                                // create a change log for the changes since last version
                                repoChanges = gitChangelog from: [type: 'REF', value: "${latestTag}"], 
                                                           to:   [type: 'REF', value: 'development'], 
                                                           jira: [basicAuthString: '__redact__', issuePattern: '\\b[a-zA-Z]([a-zA-Z]+)-([0-9]+)\\b', password: '__redact__', server: 'https://__redact__.atlassian.net', username: '__redact__'], 
                                                           returnType: 'STRING', 
                                                           template: '''{{#issues}}
{{name}} - {{issue}} - ({{link}}) - {{title}}
{{/issues}}'''
                                echo "Changes since latest version tag for ${repo}:\n${repoChanges}"
                            }
                            echo "Changes since latest version tag for ${repo}:\n${repoChanges}"

Results

Expected result:

to find jira issue titles (and other details)

Actual result:

jira issues identified, but no titles or links. no indication that any jira lookup is happening.

console snippet:

[Pipeline] echo
Latest version tag for consumer is 7.5.0
[Pipeline] sh
+ git rev-parse HEAD
[Pipeline] sh
+ git rev-parse 7.5.0
[Pipeline] gitChangelog
[Pipeline] echo
Changes since latest version tag for consumer:
Jira - MGP-7600 - () - 
Jira - MGP-7658 - () - 

Thanks!

There were 2 bugs recently, #60 and #62, with problems in the Jira integration. They got stacktraces in their log.

This is on my TODO list.

I am also having troubles getting Jira information for my tickets. Are there any updates to this?

Could it have something to do with the Jira version? How can I debug this?

Probably same as #71, closing this issue.