Rest api add user to group - Cannot edit group memberships

Tien Hoang July 3, 2017

I got that error message when trying to add a user to group via rest api 

{"errorMessages":["Cannot edit group memberships, as external user management is enabled, please contact your JIRA administrators."],"errors":{}}

My curl - running with site admin account

curl -u u:p -X POST -H "Content-Type: application/json" --data '{"name":"test6"}'  https://host/rest/api/2/group/user\?groupname\=administrators

Please help, thanks :)

2 answers

1 vote
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 4, 2017

Cloud uses "external management" automatically.  You can't amend users and groups in JIRA on Cloud, and that's why your REST calls are failing.

You have to do it via Cloud user management which you can get to through the JIRA admin UI, but it's actually a separate system.  That does not support REST calls for updates (yet - Atlassian have it on the list and have said they're going to do it)

0 votes
Stefan Arnold
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.
July 4, 2017

Maybe you use external user management?

When you use as example active directory for user management and the connection is set to

Read Only
Users, groups and memberships are retrieved from your LDAP server and cannot be modified in JIRA.

then you cant modify the group memberships with restapi.

Can you add users to groups in jira directly?

 

Tien Hoang July 4, 2017

Yes i can add user to group in Jira admin directly and my cloud instance just completely new with all default setting. 

Stefan Arnold
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.
July 4, 2017

mmh, tried you curl statement and its working fine for me. correct response and the test123 user is correctly added to jira-administrator group. iam using jira server so iam not sure if some rest api calls are not allowed for cloud.

$ curl -k -u admin-p -X POST -H "Content-Type: application/json" --data '{"name":"test123"}'  https://host/rest/api/latest/group/user\?groupname\=jira-administrators
Enter host password for user 'stefanadmin':
{"name":"jira-administrators","self":"https://host/rest/api/2/group?groupname=jira-administrators","users":{"size":8,"items":[],"max-results":50,"start-index":0,"end-index":0},"expand":"users"}
Tien Hoang July 5, 2017

Yes seems that it not work on jira cloud :( 

Fernando Boucquez (PPL) July 12, 2017

We are facing the same problem in some cloud hosts, newer ones. The odd thing is that old hosts also have centralized user managment but changing groups memberships works?

nm
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 1, 2017

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events