0

I am trying to create new users using JIRA REST API. However the post method syntax description is empty when I am checking the REST documentation. Does anyone know the JSON syntax and the REST handle for creating new users?

3 Answers 3

2

The JSON Object to use is:

{ 
"name":"username",
"password":"****",
"emailAddress":"username@local",
"displayName":"user name",
"notification":"false" 
}
Sign up to request clarification or add additional context in comments.

1 Comment

This one works perfectly. The REST handle is /rest/api/2/user. Thanks for the help. Do you know any way of deactivating the added user via REST. I tried a PUT to change the "active":true to "active":false. But it doesn't seem to work.
1

The user creation via REST for JIRA installed version or on-demand version is available using the rest handle

/rest/api/2/user

A POST call should be made with the the following values in the header

Content-Type:application/json

Authentication:Simple username:password

Note: The Username:Password in the authentication header should be encoded in base64 format

The JSON to post is as follows

{
    "name": "<Username>",
    "password": "<Password>",
    "emailAddress": "<Email Address>",
    "displayName": "<Display Name>"
}

The users will be created in jira-users group and the will be active. The active status cannot be changed while creation or after creation using a PUT call. This is a major constraint.

Comments

0

I would try calling a GET service for the user resource and use the same jSon object structure to POST creation of a new user.

2 Comments

Answer by LukeSolar works fine. Thanks for the response
I've tried to give a general answer on how to get the definition of a jSon resource that may be helpful in other cases, not only in this specific case.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.