0

I'm using Jenkins multi-branch pipelines and SVN.

In the Blue Ocean view, a Commit version is shown. This version is always the highest revision number of the repository as a whole. I want it (or another field) to show the last changed version instead, either on the 'Activity' or 'Branches' page for the pipeline.

e.g, I commit revision 10500 to branch A. I commit revision 10501 to branch B. I trigger another build on branch A for whatever reason. The 'commit' version shows in the UI as 10501, whilst the last changed revision is still 10500, which is what I want to show. Is there any way to do this?

AndyK
  • 298
  • 1
  • 3
  • 9

1 Answers1

0

Alright, so here's what I came up with:

The displayName and description of the currentBuild are writable properties (the commit number is not, unfortunately) so I decided to edit one of them. I couldn't seem to append text to the description without wiping out the original commit message, which was undesirable. So I appended it to the build number (displayName) instead.

script  {
    currentBuild.displayName = currentBuild.number + "-" + env.SVN_REVISION
}

I'll leave this question open for another week in case someone else comes up with a better answer

Alex Weitz
  • 3,199
  • 4
  • 34
  • 57
AndyK
  • 298
  • 1
  • 3
  • 9