Noting https://github.com/jenkinsci/jenkins/pull/5936 for backport
Merged into stable-2.319 as 9170cf3f18708862d4a11804d8b733b4e8885f73
Merged into stable-2.319 as 9170cf3f18708862d4a11804d8b733b4e8885f73