Update user information via REST

Morten Christophersen January 7, 2023

Hi, 

We have imported quite a few users, but did not set the externalId. Im now trying to use the REST interface for it. I have several script running just fine. But when Im trying to update a user via the POST function I constantly get a response 400: "Description is required". Earlier I have a "description is required, region is required" This was solved by adding region information to the user. However, there is no description field on a user...

I would like to hear if others have had this problem. or have suggestions on how to solve it. 

1 answer

1 accepted

2 votes
Answer accepted
Heidi Hendry
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.
January 8, 2023

Hi Morten,

POST function will only create a user it will not update a user.

Try using PATCH instead with the relevant JSON patch document.

Check out https://your-jira-align-instance/rest/align/api/docs/index.html to see the Swagger for the Users Endpoint.

users.png

 

Try a PATCH request on the user id with the JSON information

[
{
"op":"replace",
"path": "/externalId",
"value": "new external id here"
}
]

Morten Christophersen January 11, 2023

Thanks for your input. I can see that I wrote wrong in the first post im using the "PUT" command. using first "get", then update the user and then "put". 

I have tried using the patch function. this was succesfull:-)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events