CodeBeamer
Collaborative ALM as a Service
CodeBeamer 5.4.2 on Amazon EC2 medium instance
         
Groovy Automation Scripts
Tags:   No tags associated yet.
All Tags...
Download
- nbalm-0.8.5.zip

Links
- Java
- Netbeans
- codeBeamer

Recent News
Project Created
Nov 06, 2007 03:42

Failed to fetch feed from "http://www.netbeans.org/rss-091.xml"
java.net.SocketTimeoutException: Read timed out
[ edit ] [ properties ] [ hide ]

Groovy Automation Examples

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} "
    }