Label class method getTiedJobCount() returns wrong results when label in job contains blanks

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      Create a freestyle job and let it run on a label expression that contains blanks, e.g. "label1 && label2"

      In Script console get the label:

       

      l = Jenkins.get().getLabel("label1 && label2")
      l.reset()
      println(l.name)
      println(l.getTiedJobCount())
      

      The output is 

      "label1&&label2"
      0

      Note that the blanks are removed when printing the label name.

      The problem is that the method getTiedJobCount() loops over all jobs and then just does a simple String comparison of p.getAssignedLabelString() with the label name.

            Assignee:
            Unassigned
            Reporter:
            Markus Winter
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Archived: