Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

Rest call not returning updated info


I've created a REST endpoint using script runner to view all filters owned by a certain JIRA user.

The REST call returns the filter id and the JQL string in a json format.

When the JQL string in a filter is changed in JIRA is does not reflect in the REST call.

def filterManager = ComponentAccessor.getComponent(SearchRequestService)
def queryManager = ComponentAccessor.getComponent(Query)
def userManager = ComponentAccessor.getUserManager()

def user= userManager.getUserByName("JIRA-USER")

def queries = [:]

for (query in filterManager.getOwnedFilters(user)){

@BaseScript CustomEndpointDelegate delegate

httpMethod: "GET", groups: ["JIRA-GROUP"]
) { MultivaluedMap queryParams, String body ->
return Response.ok(new JsonBuilder([Filters: queries]).toString()).build()

Can you please give me some insight on why this might be happening.

Also, when I run the code in the Console I get the updated JQL string.

0 answers

Suggest an answer

Log in or Sign up to answer

Atlassian Community Events