Forums

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

How to set dashboard viewers and Editors using script runner

Michael Shechter April 26, 2020

Hello,

due  restriction that user can't share dashboard to group isn't member of, I'm searching    how to add a group to dashboard viewers and Editors using script runner.

Can someone help me with this?

Thanks.

1 answer

1 accepted

0 votes
Answer accepted
Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 28, 2020

Hi Michael,

I understand that you want to be able to share a dashboard in Jira Server with specific groups, but that due to the current limitations within Jira you cannot do this for any groups which your account is not a member of.

Scriptrunner has a number of built-in scripts.  One of these is the Switch to a different user.  This feature is only available to Jira Admins.  More details on this specific feature in https://scriptrunner.adaptavist.com/5.9.1/jira/builtin-scripts.html#_switch_user

What you could do would be to switch to a user that does have this group membership and then let that user make changes to the share of that dashboard.  The tricky part about this is that you would need to know which group memberships this account has before you switch, and that user would also need to have the Global Permission to Create Shared Objects for them to be able to share this dashboard with others. 

If I was going to do this, I would start with looking at which groups have that global permission, and then use the User management in Jira to try to lookup which users have that permission as well as the group membership to the group that you want to share it to.  If none of the users in that group have that global membership you will need to either give them the global permissions first or do something like create a service account that has all the group memberships and the global permissions needed to make this kind of change.

However Scriptrunner is not the only solution here. There are also other solutions in Marketplace, such as the User Switcher for Jira that could help here in terms of account impersonation.

Try this and let me know if you run into any problems here.

Andy

Michael Shechter April 29, 2020

@Andy HeinzerThanks!

Suggest an answer

Log in or Sign up to answer