[JIRA] (JENKINS-61450) Cant filter streams with P4Groovy

1 view
Skip to first unread message

kwirth@perforce.com (JIRA)

unread,
Mar 12, 2020, 5:57:02 AM3/12/20
to jenkinsc...@googlegroups.com
Karl Wirth created an issue
 
Jenkins / Improvement JENKINS-61450
Cant filter streams with P4Groovy
Issue Type: Improvement Improvement
Assignee: Unassigned
Components: p4-plugin
Created: 2020-03-12 09:56
Labels: P4_VERIFY
Priority: Minor Minor
Reporter: Karl Wirth

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'];
      }
   }

 

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages