Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to execute a filter in script runner

Adolfo Casari
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 4, 2013

I would like to execute an existing filter by its ID and iterate throught the results, using script runner (groovy).

Is there any example or code snippet on how to do it?

Thanks in advance,

1 answer

1 accepted

1 vote
Answer accepted
JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 4, 2013
def ctx = new JiraServiceContextImpl(authenticationContext.getUser());
def sr = searchRequestService.getFilter(ctx, results = def searchProvider.search(sr.getQuery(), authenticationContext.getUser(), PagerFilter.getUnlimitedFilter())
def issues = results.getIssues();
issues.each {issue-> /*DocumentIssueImpl*/ ... }

I just copied and pasted from different classes, but something like the above.

Anand Unadkat
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 13, 2014

Hi Jamie,

How do I get filter ID from this method? sr.getQuery(123456)?

Thanks

Like Luisa Falk likes this

Suggest an answer

Log in or Sign up to answer
TAGS
Atlassian, Team '25 Europe, Atlassian conference, AI-powered teamwork, Atlassian events, keynote speakers, Barcelona tech conference, Atlassian Williams Racing, Carlos Sainz, Jenson Button, Mike Cannon-Brookes, Anu Bharadwaj, Atlassian Rovo

Atlassian Williams Racing is coming to Team '25 Europe 🏎️

Discover the teamwork and precision behind success on and off the track. See how this high-performing team makes the impossible possible. Be one of the first 100 customers to register for a chance to win 2 tickets to an Atlassian Williams 2026 race.

Register now
AUG Leaders

Atlassian Community Events