<< Back to previous view

[QB-3982] [Build Condition]"If specified script evaluates to true" not worked
Created: 07/Jun/23  Updated: 08/Jun/23

Status: Closed
Project: QuickBuild
Component/s: None
Affects Version/s: 13.0.18
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Bin Wu Assigned To: Robin Shen
Resolution: Won't Fix Votes: 0
Remaining Estimate: Unknown Time Spent: Unknown
Original Estimate: Unknown
Environment: linux quickbuild 13.0.18


 Description   
I want to download the 3rd part package into QB, with configure the 'tag' variable to control the version
already create another configure to automation update the 'tag', but when test with "If specified script evaluates to true" on "Build Condition", it always been execute by "Schedule"
I also setup the "Next Build Version" to the "tag"

This my script:
groovy:
last_build = configuration.getLatestFinishedBuild()
 
if ( last_build != null ) {
  return ! (last_build.getVar('tag') == configuration.findVarValue('tag'))
}
 
return true

So I couldn't understand why it can be execute by "Schedule", because the "tag" is not change


 Comments   
Comment by Robin Shen [ 07/Jun/23 12:11 PM ]
Below statement will always evaluates to false:

last_build.getVar('tag') == configuration.findVarValue('tag')

As you are comparing variable with viarable value. Try this instead:
last_build.getVarValue('tag') == configuration.findVarValue('tag')

Comment by Bin Wu [ 08/Jun/23 01:22 AM ]
thank you for point this
Generated at Thu Oct 31 23:47:17 UTC 2024 using JIRA 189.