SyntaxFix
Write A Post
Hire A Developer
Questions
A colleague told me to use scm.branches[0].name and it worked. I wrapped it to a function in my Jenkinsfile:
scm.branches[0].name
def getGitBranchName() { return scm.branches[0].name }