API support for manually validating advanced builds in Jenkins?

Is there a way to programmatically approve an advanced Jenkins build? The job configuration is set to Manual Approval Only.

+4
source share
2 answers

Yes! Although I did not find any documentation for it, and therefore it may not be a stable solution. I found this using browser developer tools. Make sure that the "Only when manually confirming" checkbox is selected.

Here is an example:

curl 'https://jenkins/job/z-promotion-test/3/promotion/promotionProcess/promotion_test/promotionCondition/hudson.plugins.promoted_builds.conditions.ManualCondition/approve' --data 'json=%7B%7D&Submit=Approve'

Authenticated version

curl 'http://<user>:<token>@jenkins/job/z-promotion-test/3/promotion/promotionProcess/promotion_test/promotionCondition/hudson.plugins.promoted_builds.conditions.ManualCondition/approve' --data 'json=%7B%7D&Submit=Approve'

Cm

+2
source

. / . n . , . . URL API (curl) Job Jenkins

, 2 , , .

0

All Articles