User management using REST APIs

Sadam July 25, 2017

Hi There,

I am new to JIRA, so kindly excuse if this question is very silly :)

I am trying to perform the User Management operations using the REST APIs. I was able to Create, Delete & Search (for single user using the username paramater).

I am not able to update user information (like emailAddress or displayName) using PUT method. Can you please let me know what I'm missing here:

I created the user using following POST method (/rest/api/2/user)

{
    "emailAddress": "test.provisioning@example.com",
    "name": "test.provisioning",
    "displayName": "TestProvisioning"
}

And the user got created successfully. But when trying to invoke PUT method using the following JSON(for performing Update operation):

{
    "displayName": "Test2Provisioning"
}

I am getting the below error message:

"Oops, something went wrong

Please check".

Please help...

Also I would like to know of there is any approach using REST APIs to

*Fetch the whole list if users from User Management

*User Password Reset

*Enable / Disable a user

 Let me know for any further clarifications. Thank you in advance.

 

Regards,
Sadam

2 answers

1 vote
Vladimir Omelchenko _cPrime_ September 17, 2018

Hi Sadam,

The following KB might be helpful for you to work on the user management using API:

https://confluence.atlassian.com/jirakb/how-to-bulk-update-users-email-addresses-in-jira-using-rest-api-948218723.html

0 votes
Mohamed Benziane
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 8, 2018

Hello Sadam, 

You can take a look at this page who will find some code to update user

 

https://community.atlassian.com/t5/Answers-Developer-Questions/How-to-change-a-user-programatically-for-example-its-display/qaq-p/534060

 

Regards

Suggest an answer

Log in or Sign up to answer