Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-61450

Cant filter streams with P4Groovy

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Minor Minor
    • p4-plugin

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

       

            Unassigned Unassigned
            p4karl Karl Wirth
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: