I wanted to limit the list of issues to only those with link type "Epic-Story Link" using the "collect" command. I used this code:
I haven't tried, but IMO you need to use findAll() instead of collect().
The latter is not meant to be used for filtering.
findAll() will filter the collection. The closure must return a true or false to decide if the item in the collection should be returned
collect() will transform the collection (it's called "map" in many other languages). A collect() will always return the same number of items as the original collection it was called on. The closure can return anything and that's what the new collection will contain.
There is a method that combines the two. findResults{}.
This functions like a collect{} but only non-null values are kept in the resulting collection
It looks like you're new here. Sign in or register to get started.