V
V
vrtlpilot2019-05-21 23:22:19
Conveyor
vrtlpilot, 2019-05-21 23:22:19

How to get commit author email in multibranch pipeline?

Good afternoon, colleagues.
there is a task to send a letter with the result to the author of the commit (to the authors of the commits, if we are talking about PR) when building;
there is a configured job in Jenkins and the Jenkinsfile in the repository (scripted notation).
Authors and text are obtained by the following code:

def commits = currentBuild.changeSets.collectMany { it.toList().collect {  it.msg + " - _" + it.author + "_" } }.unique().join('\n')
    def authors = currentBuild.changeSets.collectMany { it.toList().collect { it.author } }.unique().join(',')

but you can't get email addresses this way.
I tried to get addresses through a script , the result is not displayed at all. Does anyone have experience with a similar task?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question