Automation of group renaming

Licencias Corporativo
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 9, 2024

Hi,

We have our Jira connected to an LDAP. That LDAP has a multitude of groups and those groups have many permissions in different projects and permission schemes in Jira.

Sometimes we are forced to make group name changes in the LDAP, which forces us to: (1) make changes directly in the database to update permissions in projects and permission schemes, and (2) restart the instance as the permissions are cached.

This approach has certain risks as product upgrades can cause database schemas to change and at some point we may mismatch data. And in addition we have to restart Jira.

Does anyone know of any addon or utility that allows us to make these changes automatically?

Thanks

Pedro

2 answers

0 votes
Gregory Kneller
Contributor
November 7, 2024

if your groups have very distinctive names, you may try to create database dump (dump.sql) and then perform shell script in unix:

sed -e 's/"old-group-name"/"new-group-name"/g; s/"lower-case-old-group-name"/"lower-case-new-group-name"/g' dump.sql > newdump.sql

 
Then you may try to attach the restored database to  an empty JIRA and test if it works.

But it may my break data, if your groups have names the same as usernames (eg. "admin"), or if the new name already exists in another user directory, or if you have another objects with the same name as the groups. 

Otherwise you shall change data in more that 10 database tables, and even more, depending on add-ons, etc.

The add-on rename-group-in-jira may be a good choice if you need to rename not too much groups, but you also need to test this first in your configuration.


And if you use LDAP, you shall first disable LDAP directory and remove the groups related to  this LDAP directory from cwd_group, cwd_membership before creating the sql dump.  

This may not be done in production instance without good tests


0 votes
Radek Dostál
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 9, 2024

https://jira.atlassian.com/browse/JRASERVER-1391 is creeping up again isn't it.

 

What you're doing is basically the only way to do it. All of the other plugins also run their own SQL to do it.

Looking at marketplace, https://marketplace.atlassian.com/search?query=rename%20group&product=jira&hosting=dataCenter, I see only one plugin:

 # https://marketplace.atlassian.com/apps/1222423/rename-group-in-jira?hosting=datacenter&tab=overview

 

I don't have any experience with it, but it seems to support a decent range of changes.

 

It wouldn't my community moment if I didn't say - don't do the sql changes, but you will, because if it's been working so far, getting people to stop doing it will take weeks of rigorous brainstorming over meetings before everyone agrees to go back to sql.

I'm not saying you can't, but we both can see it's not exactly ideal and it can potentially break something later down the line that might need some repairing.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
9.12
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events