Use $JENKINS_STARTED_BY variable (started-by-envvar plugin)