Groovy web console

subscribe to the feed Subscribe
to this
site
getJobNameTokens (via #groovywebconsole)
tweet this snippet Tweet
this
script

getJobNameTokens

Published 8 months ago by btranz
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
def getJobName(){    
    def projectUrl = "orgName/appName/branchName"
    def tokens = projectUrl.tokenize('/')
    return ["org":tokens[0], "app":tokens[1]]
}

println getJobName().org
println getJobName().app

def jobName = getJobName()
println "${jobName.org}/${jobName.app}"