Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


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

Set insight role permission on objecttypes with java


I'd like to automatize the configuration of permissions of Insight Objecttype with java or REST api. Is that supported and has anyone an idea how I can do that?

Many thanks! 

2 answers

1 accepted

1 vote
Answer accepted
Puya Alemirad
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 10, 2021


You can use the JAVA API for this. You can use:

class ConfigureFacadeImpl
public void storeActorsForRoleBean(Map<String,Set<String>> newRoleActorBeans,
int roleBeanId)

Parameter newRoleActorBeans is a map where the key is a String either “atlassian-group-role-actor” or “atlassian-user-role-actor” depending on if it’s a group or a user and the value Set<String> is either a Set of userKeys or groupName.

Parameter roleBeanId is the specific id for the role, for example the id for developer role for "Your object schema" or  manager for object type "Your object type". All these roles has their own id. 

To get the roleBeanId for the specific role you are configuring you can use either of the following methods (depending on if the role is in the objectSchema and objectType):
public List<>findRoleBeansByObjectType(int objectTypeId)
public List<>findRoleBeansByObjectSchema(int objectSchemaId)

 The method will return a list of RoleBeans, one for each role (example manager, developer and user). The RoleBean will also include the id. 

Note: When storing a new user or group to a role you'll have to include all the ones that should be in the role because storeActorsForRoleBean will replace the users and groups in a specific role and not just add new ones to it. If you don't know who or which group already was included in the role and you just want to add one then you can use the info from the RoleBean when picking up the id. The RoleBean has a variable called roleActorBeans which is a List of;
for each user/group. The RoleActorBean includes variable "type" which is either “atlassian-group-role-actor” or “atlassian-user-role-actor”  and param "typeParam" which is either userKey or groupName. 

Example 1:
You have "user1" as manager for a schema or object type and would like to add "user2" as manager as well. Your Map newRoleActorBeans should then contain both "user1" and "user2" in the set of strings for the key “atlassian-user-role-actor", and the second param should be the id for manager for the specific object type or schema. 

Example 2: You have "user1" as manager for a schema or object type and would like to add group "jira-group" as manager as well. Your Map newRoleActorBeans should then contain two entries where one contains a key "atlassian-user-role-actor" and the other entire with key “atlassian-group-role-actor” and the set of strings with the key for "jira-group". 

Hope this works for you and good luck!

Cheers // Puya
Puya Alemirad
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 10, 2021

Hey Puya, thank you very much for the extremely detailed answer!

I have the following code that finds a objectType I want and add a group to each role for that objecttype. If it helps someone then thats great.


import com.atlassian.jira.component.ComponentAccessor

def objectFacade = ComponentAccessor.getOSGiComponentInstanceOfType(ObjectFacade)
def objectTypeFacade = ComponentAccessor.getOSGiComponentInstanceOfType(ObjectTypeFacade)
def configureFacade = ComponentAccessor.getOSGiComponentInstanceOfType(ConfigureFacade
String mnemonic = 'TEST'
Integer schemaId = 5
List parentTypeNames = ['OT1, 'OT2', 'OT3']
String userName = 'myusername'
String groupName = 'jira-users'
String userRoleType = "atlassian-user-role-actor"
String groupRoleType = "atlassian-group-role-actor"

// create sets

Set<String> groupActors = new HashSet<String>()

// get mutable one of the object beans
MutableObjectTypeBean objTypeBean = objectTypeFacade.findObjectTypeBeans(schemaId).find { == parentTypeNames[1]

// find all roles
List<RoleBean> roles = configureFacade.findRoleBeansByObjectType(
roles.each {
// store the actors to role bean
configureFacade.storeActorsForRoleBean([(groupRoleType): groupActors] as java.util.Map, it?.id)

Suggest an answer

Log in or Sign up to answer
AUG Leaders

Atlassian Community Events