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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • core
    • None

      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.

            Unassigned Unassigned
            mawinter69 Markus Winter
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: