Share filters (many) JIRA API

Jorge Gattas March 10, 2014

Hi everyone

I have some groovy script to create filters, but i need to share with certain roles/groups. How can i share the filters with groovy script or jelly?

Here is my create filter code

JqlQueryBuilder builder = JqlQueryBuilder.newBuilder();
	builder.where().project(project).and().addStringCondition("issuetype", Operator.EQUALS, "Issue")
	
	Query query = builder.buildQuery();
	SearchRequest filtro = new SearchRequest(query)
	filtro.setName("TEST")
	filtro.setOwnerUserName(user)
	
	SearchRequestService srs= ComponentAccessor.getOSGiComponentInstanceOfType(SearchRequestService.class)
	srs.createFilter(ctx, filtro,true)

Thanks!

1 answer

0 votes
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.
March 10, 2014

Have a look at com.atlassian.jira.issue.search.SearchRequest#setPermissions, then

com.atlassian.jira.issue.search.SearchRequestManager#update

Suggest an answer

Log in or Sign up to answer