Can somebody give me a working script so i can run using script runner (Groovy)
in order to add all my saved filter for users Distribution automatically subscribe filters on behalf of users ?
thanks
OK, I submit. Here is the script. As someone said before you need to use a group not a username (eg carla).
Please please please close or mark correct your previous questions. If you enter lots of similar questions you are merely making it very difficult for people to help you because they don't know which question to answer.
import com.atlassian.jira.ComponentManagerimport com.atlassian.jira.favourites.FavouritesManagerimport com.atlassian.jira.issue.search.SearchRequestimport com.atlassian.jira.issue.search.SearchRequestManagerimport com.opensymphony.user.UserManager// Set the filter ID and group to share with hereLong searchRequestId = 10151String shareWith = "some group"ComponentManager componentManager = ComponentManager.getInstance()FavouritesManager favouritesManager = (FavouritesManager) componentManager.getComponentInstanceOfType(FavouritesManager.class)SearchRequestManager searchRequestManager = componentManager.getSearchRequestManager()SearchRequest searchRequest = searchRequestManager.getSharedEntity(searchRequestId)UserManager userManager = UserManager.getInstance()for (String userId in userManager.getGroup(shareWith).getUsers()) { favouritesManager.addFavourite(userManager.getUser(userId), searchRequest)}
Note that the filter needs to be shared, the script above just makes it a favourite. So share with somegroup, then run the script above with somegroup.
If you are having trouble with this perhaps you might be better off with a packaged plugin that doesn't require configuration.
click on one of the filters in your screenshow, in the url it will show the filter ID.
from where do I get the the filter ID so I can put in
Long searchRequestId ?
It looks like you're new here. Sign in or register to get started.