Beware that deleting is not the same as cancelling a build.
If I were you I'd have a look at system groovy script instead of rest api.
Cheers
how to cancel build queue jobs in jenkins by only using the "build number" through REST API, which are not started by jenkins and are in its build queue.-- I know how to cancel the in-progress job with below command- curl -X POST <jenkins-server>/job/<job-name>/<build-number>/doDelete
--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/442e4d38-c8a5-43fe-8c59-33e6c04bfbb2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.