Versions Compared

Key

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


Excerpt

This tutorial will guide you through writing Groovy scripts that loop over collections.


On this page:

Table of Contents

...

Find the count of released versions

This section of the tutorial will teach you writing a Groovy script to find the number of released versions for a project.

Code Block
languagegroovy
linenumberstrue
def count = 0;
for(i=0;i<issue.getAvailableOptions("versions").size();i++){
  if(issue.getAvailableOptions("versions")[i].isReleased()){
    count++
  }
}
count

...

Find whether a particular checkbox is selected or not

This section of the tutorial will teach you writing a Groovy script to find the number of released versions for a project.

Code Block
languagegroovy
linenumberstrue
//Find whether a particular check box is selected or not
for(i in issue.get("Scheduled tasks")){
  return(i.getValue() == "Printing")
}

...