Abstract

This code snippet filters values from a collection of objects based on a condition

Logic

Iterate over the collection of objects and filter values that meet the condition

Snippet

//Define an array to find and store the filtered values
def newValues = issue.get("<Multi-valued field name>").findAll{
  //Write the condition
	<Condition>
}
return newValues

Placeholders

PlaceholderDescriptionExample
<Multi-valued field name>Name of the multi valued fieldwatches
<Condition>Condition to meet for the value to be filteredit.getName() != issue.get("reporter").getName()

Examples

The output of this snippet is a subset of the existing values of a multi-valued field which you could use in a Groovy expression, to

References

Related articles


Related issues