Solution: For anyone getting a similar issue, this is a solution:
checkout scm: scm, poll: false, changelog: false
Problem: Same as JENKINS-40352(which is for GIT)
UsingĀ
checkout scm
checkout scm is done at:
pipeline Jenkinsfile script checkout
pipeline checkout after loading the Jenkinsfile (to get full depot)
checkout scm after cleanWs() (if requested as a parameter in the build)