Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Panel
borderStylesolid

Labels

  • Field name: Labels

  • Field ID: labels

  • Description: Labels is a Set of labels.

  • Accessing the Labels field: You can access the Labels field using any of the following getters of the Issue interface:
    • get("labels") or get("Labels") that returns a Set<Label>
      • Example: Get the first label of the issue:

        Code Block
        languagegroovy
        linenumberstrue
        if (issue.get("labels"))
        {
           issue.get("labels").first()
        }.label


    • getAsString("Labels") or getAsString("labels") that returns a String with comma separated label names:

      • Examples: Labels of the issue

        Code Block
        languagegroovy
        linenumberstrue
        issue.getAsString("labels")


    • getLabels() that returns a Set<Label>

      • Example: Get the last label of the issue

        Code Block
        languagegroovy
        linenumberstrue
        if(issue.getLabels())
        {
          issue.getLabels().last()
        }.label


      • Example: All the labels of the issue separated by a comma:

        Code Block
        languagegroovy
        linenumberstrue
        issue.getLabels().join(",")


...