Hi
I'd like to add the users to the crucible groups by using of REST API.
This was requested by a Korea Customer urgently, so I was trying to develop some script with Python.
However, I can't put the users into the Crucible group.
Here is the source code what I've been developing so far.
Could you please advise which should be changed for that?
============================================
import requests
import json
username = "hyunjun.kim1"
password = "thddkwl12"
data = json.dumps(
{"name":"hyunjun.kim1"}
)
print(data)
r = requests.get('http://crucible.hynix.com:8060/rest-service-fecru/admin/groups/Amber-FlashSolution-users/users',
auth=(username, password),
headers=(
{'content-type':'application/json', 'accept':'application/json'}
)
)
test = json.loads(r.text)[u'values']
print test
r = requests.put('http://crucible.hynix.com:8060/rest-service-fecru/admin/groups/Amber-FlashSolution-users/users',
data,
auth=(username, password),
headers=(
{'content-type':'application/json'}
)
)
print r.status_code
============================================
Thanks.
Hi Hyunjun Kim,
There is an example REST API Python client which covers user management.
https://bitbucket.org/atlassian/fecru-rest-examples/src/master/python/?at=master
create_user("example_user", "1234", "Example User", "example.user@gmail.com") create_group("example_group") add_user_to_group("example_user", "example_group")
Your usage of the REST API looks correct. What error are you getting?
mac
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.