Your browser was unable to load all of the resources. They may have been blocked by your firewall, proxy or browser configuration.
Press Ctrl+F5 or Ctrl+Shift+R to have your browser try again.

Differentiate between rest builds and manual builds #4423

Aditya ·

Is there any way to distinguish builds based on whether they are triggered via rest or triggered manually in prequeue script. I want to block user from triggering the build manually while allowing through rest api and at the same time keeping the trigger button enabled.

if(!check_via_rest()){
   throw new quickbuildException("Cannot be triggered")
else{
   //trigger new build
}
def check_via_rest(){
    // code to check if build triggered via rest
}
  • replies 3
  • views 600
  • stars 0
Aditya ·

Could you please help?

robinshen ADMIN ·

There is no way to differenticate them currently. If you want to block users from triggering it manually, why still want to make trigger button enabled?

drdt ·

What if you had a different user for REST builds? That way you could give permissions to the REST user but not to the logged-in user.