jenkinsci / git-changelog-plugin

Creates a changelog, or release notes, based on Git commits between 2 revisions.
https://plugins.jenkins.io/git-changelog
MIT License
57 stars 33 forks source link

add support for jira api token #42

Closed nemui closed 4 years ago

tomasbjerre commented 4 years ago

@nemui did you notice the failure?

nemui commented 4 years ago

fixed!

tomasbjerre commented 4 years ago

Releasing this as 2.22. Did not have much time to test it.

nemui commented 4 years ago

Nice!
Providing credentials id for basic auth will probably not work, I'm usually using withCredentials wrapper. If anyone misses this feature - it can easily be added.

tomasbjerre commented 4 years ago

This should work:

withCredentials([string(credentialsId: 'mycredentialsid', variable: 'tokenVariable')]) {
 def changelogContext = gitChangelog returnType: 'CONTEXT',
  from: [type: 'REF', value: 'git-changelog-1.50'],
  to: [type: 'REF', value: 'master'],
  jira: [issuePattern: 'JENKINS-([0-9]+)\\b', basicAuthString: tokenVariable, server: '...']
}
nemui commented 4 years ago

For sure - this is exactly how I am using it. Looking at the source code, I got the impression that username/password for Jira support Jenkins credentials in a more advance way?

tomasbjerre commented 4 years ago

Ah right! I see what you mean.

Yes, but I don't mind. I assume most people use pipeline anyway and I don't see any point in doing it that way when using pipelines.