How to rename a group in Jira

Still need help?

The Atlassian Community is here for you.

Ask the community

This Knowledge Base article was written specifically for the Atlassian Server platform. Due to the Functional differences in Atlassian Cloud, the contents of this article cannot be applied to Atlassian Cloud applications.

Purpose

An administrator may need to rename a Jira group to reflect changes their organization undergoes. This is currently not possible to do in Jira, but a feature request is under consideration:  JRASERVER-1391 - Getting issue details... STATUS

However, we can manually change a group name and all the permissions related to it through the database.

Bear in mind that such procedure is not part of Jira's intended functionality. As such, this process is not covered under the Atlassian Support Offerings and the information given here is provided as-is. It should be thoroughly tested in a development or staging environment before implementing any changes in your production instance.

Before you begin

  • Apps: This procedure won’t update the group names in apps, as this data isn’t stored in Jira’s database tables. You have to make the changes manually in each app.
  • Jira Software/Service Desk: Also, it will update the group names in the Jira platform, which is shared between Jira Core, Jira Software, and Jira Service Desk (the latter two are built on top of the platform). It might happen that group names are also stored in places specific to Jira Software or Jira Service Desk, and these won’t be updated.
  • Jira will need to be restarted, ensure to test and plan a maintenance window.

Solution

You can rename the group by running SQL statements against the Jira database. Replace the <NEW_GROUP_NAME><NEW_GROUP_NAME_LOWERCASE>, and <OLD_GROUP_NAME> with the actual names of your groups.

1. Rename the group

update
  cwd_group
set
  group_name = '<NEW_GROUP_NAME>'
  , lower_group_name = '<NEW_GROUP_NAME_LOWERCASE>'
where
  group_name = '<OLD_GROUP_NAME>'
  and group_type = 'GROUP';


2. Update the group name in all entities that are using it

UPDATE USER MEMBERSHIP
update
  cwd_membership
set
  parent_name = '<NEW_GROUP_NAME>'
  , lower_parent_name = '<NEW_GROUP_NAME_LOWERCASE>'
where
  parent_name = '<OLD_GROUP_NAME>'
  and membership_type = 'GROUP_USER';
UPDATE NOTIFICATION SCHEMES
update
  notification
set
  notif_parameter = '<NEW_GROUP_NAME>'
where
  notif_parameter = '<OLD_GROUP_NAME>'
  and notif_type = 'Group_Dropdown';
UPDATE ISSUE SECURITY SCHEMES
update
  schemeissuesecurities
set
  sec_parameter = '<NEW_GROUP_NAME>'
where
  sec_parameter = '<OLD_GROUP_NAME>'
  and sec_type = 'group';
UPDATE PERMISSION SCHEMES
update
  schemepermissions
set
  perm_parameter = '<NEW_GROUP_NAME>'
where
  perm_parameter = '<OLD_GROUP_NAME>'
  and perm_type = 'group';
UPDATE SHARED EDIT RIGHTS
update
  sharepermissions
set
  param1 = '<NEW_GROUP_NAME>'
where
  param1 = '<OLD_GROUP_NAME>'
  and sharetype = 'group';

Note: Updating shared edit rights is required only for Jira 7.12, or later. Earlier versions don't allow to share edit rights for filters and dashboards.

UPDATE FILTER SUBSCRIPTIONS
update
  filtersubscription
set
  groupname = '<NEW_GROUP_NAME>'
where
  groupname = '<OLD_GROUP_NAME>';
UPDATE COMMENT RESTRICTIONS
update
  jiraaction
set
  actionlevel = '<NEW_GROUP_NAME>'
where
  actionlevel = '<OLD_GROUP_NAME>';
UPDATE WORK LOGS
update
  worklog
set
  grouplevel = '<NEW_GROUP_NAME>'
where
  grouplevel = '<OLD_GROUP_NAME>';
UPDATE FILTERS
update
  searchrequest
set
  groupname = '<NEW_GROUP_NAME>'
where
  groupname = '<OLD_GROUP_NAME>';
UPDATE PROJECT ROLES
update
  projectroleactor
set
  roletypeparameter = '<NEW_GROUP_NAME>'
where
  roletypeparameter = '<OLD_GROUP_NAME>'
  and roletype = 'atlassian-group-role-actor';
UPDATE GLOBAL PERMISSIONS
update
  globalpermissionentry
set
  group_id = '<NEW_GROUP_NAME>'
where
  group_id = '<OLD_GROUP_NAME>';
UPDATE LICENSE ROLE GROUPS
update
  licenserolesgroup
set
  group_id = '<NEW_GROUP_NAME>'
where
  group_id = '<OLD_GROUP_NAME>';
UPDATE CUSTOM FIELD VALUES
update
  customfieldvalue
set
  stringvalue = '<NEW_GROUP_NAME>'
where
  stringvalue = '<OLD_GROUP_NAME>'
  and customfield in
    (
      select
        id
      from
        customfield
      where
        customfieldtypekey in (
          'com.atlassian.jira.plugin.system.customfieldtypes:multigrouppicker'
          , 'com.atlassian.jira.plugin.system.customfieldtypes:grouppicker'
        )
    );


3. Find filters and workflows that contain group names

Group names can also be used in filters and workflows, but just changing them with SQL statements would be too risky and could result in errors. You can run the following queries to get a list of filters and workflows that contain your group names, and then edit them in Jira.

FIND FILTERS
select
  filtername
  , reqcontent
from
  searchrequest
where
  reqcontent like '%<OLD_GROUP_NAME>%';

After you get a list of filters, go to Issues > Manage filters. Group names will usually be listed in the filter’s JQL query.

FIND WORKFLOWS
select
  workflowname
from
  jiraworkflows
where
  descriptor like '%<OLD_GROUP_NAME>%';

After you get a list of workflows, go to  > Issues > Workflows. Group names might be in the workflow’s conditions, but you need to check other details, too.


4. Restart Jira

Last modified on Nov 4, 2019

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.