2

I have a Jenkins build system up and running for a project. The build is triggered via the remote API functionality of Jenkins. When a commit is made to the project we send an HTTP request build trigger to the Jenkins process running on our local server; with a parameter that specifies the revision of the trunk project folder in the SVN repository that we want to checkout and build.

We also send the SVN username and commit message for the revision as an additional http parameter. So the URL looks like:

http://server:8080/job/ProjectName/buildWithParameters?description=[commit message]&REVISION=[revision number]

I would like to display this description parameter somewhere on the build page but I've found no obvious method of doing this via build triggering from the remote API.

Do I need to name the parameter something specific or is a plugin required for this functionality?

Alex
  • 581
  • 7
  • 21

2 Answers2

3

One way to add a description is to add a Build Description. Jenkins displays a short text description under each build in the list of builds on the left of a project page.

You could use the Description Setter plugin to set the build description from within your build.

Or you can set the Build Description with a POST to http://server:8080/job/ProjectName/latestBuild/submitDescription with the POST data: description="YOUR_DESCRIPTION_HERE". The latestBuild token can be replaced with a specific build number if you have it.

Dave Bacher
  • 15,652
  • 3
  • 63
  • 86
  • /latestBuild didn't work for me, but /lastBuild does. The only problem is that this sets the description of the last running build. If the build you just triggered is still queued, then it will not have the desired result – mac Feb 13 '15 at 15:18
1

There is this plugin to show build parameters

https://wiki.jenkins-ci.org/display/JENKINS/Show+Build+Parameters+Plugin

enter image description here

KeepCalmAndCarryOn
  • 8,817
  • 2
  • 32
  • 47
  • I've tried this plugin out and the box that contains the parameters do not appear to support line breaks. So if there are any line breaks in the commit message then they appear to cut off. Is there a way to enable text wrapping for these fields? – Alex Oct 22 '13 at 21:09
  • Alternatively, is there no built-in method/plugin to just edit the area that says "No changes." or the "Started by user anonymous" text via the remote API? This seems like a very basic desirable feature. – Alex Oct 22 '13 at 21:21