HI,
My company purchased a "On demand JIRA", now i need to create a 400 user account. Hot to create a "On demand JIRA" account by using REST API.
Please share your knowledge.
Thanks.
Community moderators have prevented the ability to post new answers.
Dear Srinivasan,
JIRA REST API for user management is available.
The rest endpoint would be:
https://yourhostname.com/rest/api/2/user
HTTP POST method to be used with JSON in a request body:
{ "name": "< USER NAME >", "password": "< USER PASSWORD >", "emailAddress": "< USER EMAIL >", "displayName": "< USER DISPLAY NAME >", "notification" : "< true / false >" //whether to sent notification to given email address or not }
You should receive HTTP 201 code if request is successful. You should use your admin credentials to execute this query.
Don't hesitate to reply in this thread if you have more questions.
--
Cheers, Ignat.
Hi Guys,
tryinhg thisn on on demand instance
user = dict() user['name'] = 'test102' user['password'] = 'Default1' user['emailAddress'] = 'email@domain' user['displayName'] = 'TestUser' user['notification'] = 'true' result = requests.post(user_url, data=json.dumps(user), auth=(jira_username, jira_password), headers = headers)
and i get
{"errorMessages":["Either the 'username' or the 'key' query parameters need to be provided"],"errors":{}}
any ideea why? something like this was working a while ago
Cheers,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nicholas.
Could you add more logging and ensure the request parameter are sent as you expect them to?
From the error message it looks like empty request body have been received by JIRA.
--
Cheers,
Ignat.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This error seems to happen because you have used a wrong rest handle. Use the handle '/rest/api/2/user'
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ignat,
Is there documentation for the OD REST API available at this time? We would like to query and manage group membership using the API.
Best regards,
Aaron
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nicholas,
JIRA REST APIs for groups are not yet available. Group APIs are expected to be delivered with further OD releases. Stay tuned.
--
Cheers, Ignat.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Does notification work? It's not in the API https://docs.atlassian.com/jira/REST/latest/#d2e3590 nor the rest browser.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hmm,
this was an intresting one, i made a http post request, over plain http, but atlassian redirected this over https and the post became a get t some point , very strange
after switching to https it worked, thank you for your help
Cheers,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi.
Yes, OD environment supports only https. If one uses http these are transformed as you have described.
--
Cheers, Ignat.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you Ignat,
that was it, i'm using requests from python, settting this, made it work
headers = {'content-type': 'application/json'}
r = requests.post(user_url, data=json.dumps(user),auth=(jira_auth.username, jira_auth.password),headers=headers)
Cheers,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No problems, Nicholas.
--
Cheers, Ignat.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Nicholas,
Do you sent the proper content type? Content type "application/json" is the expected one.
Could you attach the code sample where do you get this error?
--
Cheers, Ignat.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Guys,
dose this work for ondemand? i get a 415 <u>The server refused this request because the request entity is in a format not supported by the requested resource for the requested method (Unsupported Media Type)
Cheers,
Cristi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can add the users from a csv file using JCLI Please find more information at https://studio.plugins.atlassian.com/wiki/display/JCLI/JIRA+Command+Line+Interface
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I was very disappointed that a CLI was not only not free but fairly expensive. Hopefully we now can do what we need with the REST calls with version 7.2.x
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I can add users and add them to a group via rest. I don't know yet if I can add them to roles via REST.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you please provide link to REST API which can be used for adding users & assigning them to group?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.