I am trying to change the Jenkins\'s build # and build description through REST API using Java. I could see that in the below URL, this guys has tried to change the build de
I needed to do this in Perl (which I'm new to) and got the following to work for me:
sub ChangeJobDescription {
my $url = 'http://jenkinurl/job///configSubmit';
my $jsonData = '{"displayName" => "", "description" => ""}';
my $ua = LWP::UserAgent->new();
my $req = POST($url,
Content_Type => 'application/x-www-form-urlencoded',
Content => [ 'Submit' => 'save', 'json' => $jsonData ],
);
$req->authorization_basic('user', 'password');
my $response = $ua->request($req);
print $response->as_string;
}