|
Collaborative ALM Free SaaS for open source projects on Amazon EC2 |
|
|
| Groovy Automation Scripts |
|
|
| Tags: No tags associated yet. |
|
All Tags... |
Accessing the project environment:
println "working with '${project.name}'"
println "I am '${project.env.user}' logged in from '${project.env.URL}'"
Show the id for 'Tasks':
id = project.trackers.find {it.name == "Task"}.id
println "Tracker id: ${id}"
Show all the tracker items in 'Tasks':
println "All items in tasks"
project.trackers.find {it.name == "Task"}.items.each {
println " ${it.summary} - ${it.status}"
}
Find all all the tracker items in 'Tasks' that are closed:
println "All closed items "
project.trackers.find {it.name == "Task"}.items.findAll{
it.status == "Closed"
}.each {
println " ${it.summary} - ${it.status}"
}
Any closed items, do we need to build?
needsBuild = project.trackers.find {it.name == "Task"}.items.any {
it.status == "Closed"
}
println " Do we need to build - ${needsBuild}"
if (needsBuild) {
println "starting build ...."
log = project.builds.find{it.name == "Project Statistic"}.invoke()
println " Build done: ${log.status} "
println " Output: ${log.stdOut} "
}