Receive an HTTP Post request and access it's contents for a parameterized build

56 views
Skip to first unread message

Oli Spicer

unread,
Dec 7, 2016, 8:15:12 AM12/7/16
to Jenkins Developers
I work in a .NET environment with Team Foundation Server on premises for version control.  I recently configured a Jenkins server to integrate test automation etc...

My aim is to trigger a Jenkins Build when my TFS Build has succeeded, which I have done.

My problem is this:  
  To trigger the Jenkins Build, I use a Team foundation Web-hook which essentially sends an HTTP Post request to the Jenkins REST API, launching the build.  
  The contents of the post request ( JSON ) contains information on the TFS build which I need, but I have yet to find a way to access the information and use it in Jenkins.
  
  Does anyone know of a solution to this problem ? To be able to read the contents of an HTTP request and use it in a build ?

  If not, then I plan on developing a plugin to make this possible.
  If anyone knows of a good place to get started on developing a plugin, any information would be much appreciated.

Thank you,

Oliver

Daniel Beck

unread,
Dec 7, 2016, 8:49:19 AM12/7/16
to jenkin...@googlegroups.com

> On 07.12.2016, at 14:15, Oli Spicer <oli.s...@gmail.com> wrote:
>
> If anyone knows of a good place to get started on developing a plugin, any information would be much appreciated.
>

https://wiki.jenkins-ci.org/display/JENKINS/Extend+Jenkins

I know it looks terrible, but there's a lot of documentation in there, just need to click a few more links than in better structured docs.

Oli Spicer

unread,
Dec 7, 2016, 9:06:34 AM12/7/16
to Jenkins Developers, m...@beckweb.net
Thank you, no worries I'll work my way through it.

Mikel Sanchez Herrero

unread,
Oct 2, 2017, 10:59:01 AM10/2/17
to Jenkins Developers
Hi Oli, did you get any information about your problem? i need the same as you

Tomas Bjerre

unread,
Oct 2, 2017, 11:43:10 AM10/2/17
to Jenkins Developers

Oli Spicer

unread,
Oct 2, 2017, 2:41:01 PM10/2/17
to Jenkins Developers
In the end I had to develop my own plugin. Unfortunately I cannot share it, but the plugin Tomas Bjerre developed seems to be what you are looking for.

If not, this is roughly what I did in my plugin:
- Extended the Jenkins API to add an endpoint.
- Made a "Web Method" that would receive the Team Foundation Server's request
- Browse through the request's content to find the data I was looking for
- Launch an HTTP request of my own to start the Jenkins Job 

I hope you manage to resolve your problem. If not I'm happy to help.
Reply all
Reply to author
Forward
0 new messages