Clone group memberships to a new user from an existing user

We use groups heavily to manage our permission model. It is made up of groups to get access to our permissions schemes, and also to lock down transitions in some of our workflows.


Usually, when creating new users, they don't need that many groups to be added, but for some roles, it's necessary for us to add a large number of groups. While the level of control and visibility benefits us greatly, it can be very time consuming to create new users in those roles.


It would be perfect for us if there was a means of applying multiple groups to a new user quickly. If it were possible to copy group memberships to a new user from an existing one, that would work brilliantly. Even if I could enter a comma-separated list of groups into the Edit Groups form, that would work well enough for us.


Any ideas?



1 answer

1 vote
Tarun Sapra Community Champion Aug 15, 2016

Hi Darren,


Currently, it's an open request -

But I implemented something similar using a python script, which takes existing username and new username as input and adds the new user to all the groups same as the existing users. Crowd/JIRA have REST Apis thus it's easy to implement such functionality.

Tarun Sapra Community Champion Aug 15, 2016

Please see here - you can retrieve the details of a user and add his groups to a list and then map these groups to the new user. 

Thanks Tarun,

I'd spotted that suggestion earlier, but I thought it was more to do with moving users/groups between directories, rather than group memberships between users. Still probably worth a watch, though.

I'm not a huge scripting wizard (at the moment!) but I'll bear this idea in mind. I'll see what I can do with Python, or maybe see if I can wrap my head around @Adaptavist Script Runner to do it.

Tarun Sapra Community Champion Aug 15, 2016

The Adaptavist script runner isn't stand alone as far I know, but by python script I meant to have a stand alone script which will the the work for you. But yeah, you can user the script runner to have the groovy script in the post-function of the workflow of an issue. And for that issue have two fields , one having existing username and one having new username and then use a REST call to copy existing one's groups to new one, an example of rest call -

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 29, 2018 in Jira

How to set up an incident workflow from the VP of Engineering at Sentry

Hey Atlassian community, I help lead engineering at Sentry, an open-source error-tracking and monitoring tool that integrates with Jira. We started using Jira Software Cloud internally last year, a...

1,089 views 0 8
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you