Following groovy code returns an empty result:
def output = p4.run('streams','-F','"Name=mainX"','//streams/...')
At the command line we get a result:
$ p4 streams -F "Name=mainX" //streams/... Stream //streams/main mainline none 'mainX'
Usage Case:
To get the stream path from the BRANCH_NAME when using multi branch and helix streams.
Workaround:
def output = p4.run('streams','-T','Name,Stream','//streams/...') output.eachWithIndex{item, index -> output[index].each{ key, value -> if (value == "mainX") println output[index]['Stream']; } }