Jump to content
  • bulk assign role to the users under the same organization


    jzhou_1

    Requirement:

    The customer would like to assign the newly created role to all the users under the same organization.

    However, due to the huge amount of users under the same organization, the manual work would be too much trouble. The customer would like to know if there is any workaround to achieve the same.


    Solution:

    Unfortunately, there is no existing feature in our product to automatically assign the role to all the users under the organization. The role is created under the organization level need to be assigned to each user manually from web UI. 

     

    However, there is a workaround which you can try to update the repository user role mapping table "jiuserrole" to speed up the process.

    Please follow the steps as following: 

    1. Find the organization id from table "jitenant". Use the following query as example: 

      select id from jitenant where tenantid = 'organization_x';
      
    2.  Find the role id you just created under the organization from table "jirole" with the following query: 

      select id from jirole where tenantid = xxxx and rolename = 'ROLE_XXXX';
      
    3. Find all the user id under this organization from table "jiuser". Use the following query as example: 

      select id from jiuser where tenantid = xxxx;
      
    4. Insert the user role mapping records into table "jiuserrole". Use the following query as example: 

      insert into jiuserrole values (role_id,user_id1); 
      insert into jiuserrole values (role_id,user_id2); 
      insert into jiuserrole values (role_id,user_id3); 
      insert into jiuserrole values (role_id,user_id4);
      

    User Feedback

    Recommended Comments

    There are no comments to display.



    Guest
    This is now closed for further comments

×
×
  • Create New...