jenkinsci / atlassian-jira-software-cloud-plugin

Atlassian Jira Software Cloud Plugin
https://plugins.jenkins.io/atlassian-jira-software-cloud/
Apache License 2.0
43 stars 46 forks source link

ARC-1510: extract issue keys from env vars #92

Closed thombergs closed 1 year ago

thombergs commented 1 year ago

This PR modifies the issue key extraction from the branch name to also include the environment variable CHANGE_BRANCH that Jenkins injects to a pipeline. The previous solution only looked in the branch name provided by the Jenkins API, which looks something like "PR-1" when the branch is a pull request branch. This means that the actual branch name was not checked for issue keys in those cases!

The problem with looking in the env var is that this env var is also injected in the CI build of this project, which led to some tests failing. So I also had to make the tests more lenient so they run both locally and in the CI.