问题
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?
回答1:
The JSON Object to use is:
{
"name":"username",
"password":"****",
"emailAddress":"username@local",
"displayName":"user name",
"notification":"false"
}
回答2:
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.
回答3:
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.
来源:https://stackoverflow.com/questions/26609725/create-new-users-using-jira-rest-api