How to add/delete group from user roles in project roles?

Tayyab Bashir Community Champion May 09, 2017

Hi,
JIRA Version: 7.2.6

I want to add a group "ABC" and delete a group "XYZ" from the user roles in Project roles, of all the projects. 


Since there are over 250 projects and every project has XYZ added as a group in project roles, I can't manually go in each project and delete that group and replace it with ABC. 

How can I do it with some automation? 

Regards,
Tayyab

3 answers

1 accepted

This widget could not be displayed.
Tayyab Bashir Community Champion May 10, 2017

I was able to solve this with REST calls. 

I made a rest call and got all the projects. 
From that I retrieved all the project ids. 

Then I traversed through all the IDs, and made POST and DELETE requests for adding and deleting groups alternatively. 

Following are the rest calls:

1. For getting all the projects

http://localhost:8080/rest/api/2/project

2. For Adding group.

http://localhost:8080/rest/api/2/project/'+projectId+'/role/'+projectRoleID+

3. For Deleting group.

http://localhost:8080/rest/api/2/project/'+projecId+'/role/projectRoleID?group=groupToDelete

HI Tayab

Delete call is not working 

i'm getting http status code as no content and user is not deleted

any help?

Thanks in advance 

This widget could not be displayed.

Only way I can think of doing this is with scripting or add-ons

(Well, ok, database hackery, but I simply cannot recommend that.  Ever)

This widget could not be displayed.
Alex Christensen Community Champion May 09, 2017

Might be kind of a wonky solution, but would this work for you?

  1. Remove all users from group XYZ.
  2. Add the necessary users into group XYZ.

I can't tell if ABC is a brand new group you're creating or an existing one, but if it's a brand new group, I guess you could just use the existing XYZ group if none of the existing members in XYZ need access to those 250+ projects anymore.

Also, I don't think you can change the name of a user group in JIRA once it's created, so you'd be stuck with "XYZ" - not sure if that would be an issue for you.

Thought I'd throw that our there, at least. Other than this, I can't think of anything that Nic didn't already say.

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

139 views 2 0
Join discussion

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