From where i can retreive the page portal id ? in order to assign all saved favorite filter on behalf of all users
I am running this script and selected user Carla but i want to runit for all users
Result: |
no return value |
import com.atlassian.jira.ComponentManager
import com.atlassian.jira.favourites.FavouritesManager
import com.atlassian.jira.portal.PortalPage
import com.atlassian.jira.portal.PortalPageManager
import com.opensymphony.user.UserManager
// Set the portal page ID and group to share with here
Long portalPageId = 10308
String shareWith = "carla"
ComponentManager componentManager = ComponentManager.getInstance()
FavouritesManager favouritesManager = (FavouritesManager) componentManager.getComponentInstanceOfType(FavouritesManager.class)
PortalPageManager portalPageManager = (PortalPageManager) componentManager.getComponentInstanceOfType(PortalPageManager.class)
PortalPage portalPage = portalPageManager.getPortalPageById(portalPageId)
UserManager userManager = UserManager.getInstance()
for (String userId in userManager.getGroup(shareWith).getUsers()) {
favouritesManager.addFavourite(userManager.getUser(userId), portalPage)
}
Samir, you have asked this same question (or variations thereof) four times in the last few hours.
https://answers.atlassian.com/questions/4693/page-portal-id
https://answers.atlassian.com/questions/4243/how-to-add-automaticly-favorite-filters
https://answers.atlassian.com/questions/4510/script-runner-error-long-portalpageid
Please keep similar comments to a single question - you'll find:
* You'll get much better responses when people understand the context,
* Others with similar problems in the future can find all the answers they need in one place, and
* People who are not interested in the question can skip it easily.
I am going to close this question, for this reason.
The script is looking for members of the group you specifed as the value for shareWith. If carla is a user name rather than a group name, then it won't work.
Also portalPageId should be set to the id of the dashboard page you want to share. From the bottom line of your screenshot, it's "10200".
BTW, is there (or shouldn't there be) a limit as to how many questions one person can ask? Enough already. :-/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The script provided in the earlier comment seems to be provided for use with dashboards and not for issue filters. I believe this can be done with little modifications in the script
So i need one working script for Filters and not dashboard
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
BetsyW >BTW, is there (or shouldn't there be) a limit as to how many questions one person can ask?
No, there shouldn't be a limit. Questions to which the answer is "what does your log say", "here's the documentation" or "LMGTFY" should be limited though...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.