Use http://javadoc.jenkins-ci.org/hudson/model/Run.html#getCauses() instead of testing for empty changeset to see if the build is manually triggered.