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
}