Hello QuickBuild Community,
I'm using QuickBuild Version 13.0.22 and currently working on a promotion condition script in QuickBuild and I've encountered an issue when trying to retrieve a list of running builds. I want to disable the promotion button if there are any builds currently running for a specific promotion flow.
Here's the line of code that's causing trouble:
def runningBuilds = buildManager.runningBuilds
When I use this line in my script, I receive an error message indicating that the expression cannot be evaluated. I've tried including various imports, but the issue persists.
// Retrieve the list of running builds from the system
def runningBuilds = system.buildManager.runningBuilds
// Specify the name of the current promotion
def currentPromotionName = "Name of my promotion" // Replace with your actual promotion name
def isPromotionRunning = runningBuilds.any { build ->
build.getPromotion().getName() == currentPromotionName
}
// If there is a running build for the promotion, return false to disable the button
if (isPromotionRunning) {
return false
}
return true
Thank you in advance.