jenkinsci/parameterized-remote-trigger-plugin — pull request #3 by timbrown5 (2014-03-28 10:28:58+00:00)
Title: Fix for JENKINS-22325

I felt responsible for this issue as I caused it by implementing the JSON response from sendHTTPCall so I thought I should submit a fix.

Please feel free to use or ignore this as you wish.

As per comment in Issue:
Looks like the URL used when no parameters are provided (normalBuildUrl=build) doesn't return any JSON. When the paramerizedBuildUrl URL is used (buildWithParameters) Jenkins returns a JSON string that is converted into an object.

I looked into just using 'buildWithParameters' for both, but I get a 500 error when calling non-parameterised jobs with 'buildWithParameters'.

I see two options:
You can update sendHTTPCall to return null when no JSON is returned from the remote Server. The main issue with this method is all calls to sendHTTPCall will have to check response for null values.
Either that or pass the bug to JenkinsCore to ask them to return JSON objects from 'build' link.

Note: I have implemented the first option (as the second would rely on a specific version of Jenkins or above).