jenkinsci/git-changelog-plugin

Cannot get Jira issues titles after plugin update to version 2.19

Closed this issue · 6 comments

  • Plugin version used.
    2.19 (updated from version 2.17)
  • Jenkins version used.
    2.190.1
  • Configuration:
    • Freestyle job

    • changelog template:

      {{#issues}}
      {{#hasIssue}}
      - {{issue}} - {{title}}
      {{/hasIssue}}
      {{^hasIssue}}
      - {{name}}
      {{/hasIssue}}
      {{/issues}}

    • Jira credentials provided from Jenkins credentials manager

  • Expected result:
    Generated changelog contains Jira issue title.
  • Actual result:
    Generated changelog doesn't contain Jira issue title.

Looks like after plugin update from version 2.17 to version 2.19 it's not logging in properly to Jira server. It's just my guess because plugin doesn't fail the job even if wrong credentials are provided. There is also no information in the logs about Jira login success/fail status.

Downgrading plugin to version 2.17 brings back the Jira integration functionality.

Strange, does it also dont work with pipelines?

No response, closing

Hi Tomas,
I tried plugin update from 2.17 to 2.20 and issue still exists. About pipeline jobs I don't use them in my configuration and actually have no experience in this area. I have created simple pipeline job just to test the plugin and got titles from Jira. But in this case password and username were hard-coded in the pipeline script. I think issue is related to credentials taken from Jenkins credentials manager.
Is there a way to use credentials from Jenkins credentials manager in pipeline script?

I have observed one more thing. Jobs that were modified after gitchangelog plugin update will have credentials checkbox unchecked after downgrading to version 2.17. Jobs that were not touched after update and then downgrade to version2.17 are ok and have credentials set as before update.

Yes, you can use:

withCredentials([usernamePassword(credentialsId: 'yourid', usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD')]) {
 def changelogContext = gitChangelog returnType: 'CONTEXT',
  from: [type: 'REF', value: 'git-changelog-1.50'],
  to: [type: 'REF', value: 'master'],
  jira: [issuePattern: 'JENKINS-([0-9]+)\\b', password: PASSWORD, server: '', username: USERNAME]
}

See: https://wiki.jenkins.io/display/JENKINS/Credentials+Binding+Plugin

Thanks. I tried and can confirm that pipeline jobs are working, but in this case credentials are provided via Credentials Binding plugin. Freestyle jobs still have the issue. I also tried with newly generated credentials and every time there is no title populated from Jira.