null511/Jenkins.NET

Failed to build Jenkins Job

Closed this issue · 4 comments

Hi,

i'm trying to run a jenkins job using the build runner.
i am getting exception "Failed to build Jenkins Job ... ".

the parameters of the jenkins client seem ok i added the URL, user and password needed.
i also added a dictionary with build parameters.
the same parameters work with the "jenkins-cli.jar" -
is there anything i'm missing?

Thanks
Asher

adding more information:
i've added the token= to the token of the build, and if i take the URL your build, copy paste it to chrome it succeeds, but for the httpWebrequest i get:
“The remote server returned an error: (403) Forbidden”

My apologies, the documentation is a work-in-progress that doesn't get much attention. I'll finish updating the Creating the Client Wiki page sometime today.

What was not documented is that you need to use the matching ApiToken of the user for the password, not the actual password.

var jenkinsClient = new JenkinsClient {
    BaseUrl = "http://localhost:8080",
    UserName = "admin",
    Password = "0123456789ABCDEF",
};

I've updated the Wiki page, and will be considering renaming the Password property to ApiToken in the next major release. Please let me know if this corrects your issue.