Accessing the committer's name as a Jenkinsfile environment variable
I'm not entirely sure what you're trying to ask in your question, so I'm answering the question I believe you're trying to ask.

A build does not necessarily have a single commit author.  It has a list of committers, which can be empty or can contain many committers.  To create this list, you can use this snippet in a scripted Pipeline (note that you may need to disable the sandbox in order to use .collect()):

changeAuthors = currentBuild.changeSets.collect { set -&gt;
  set.collect { entry -&gt; entry.author.fullName }
}.flatten()


I use this with Git as my SCM; I'm not sure if it works with other SCMs.

See also the following questions on StackOverflow (some answers may be outdated):


How to get culprits or committers inside a Jenkins workflow with one or more SCMs
How do you pull git committer information for Jenkins pipeline