How to add users using Python ?

onebuckethuso March 7, 2018

Hello people this is my first question.

I've been looking for the answer all this morning.

I'm using jirapy extension to use jira API. I've successfully connected to the system and created a new user like; 

jira.add_user(huseyin_test, huseyin@jira.com, directoryId=1, password=None, fullname='Test Hüseyin', notify=True, active=True, ignore_existing=False)

The problem is when I add a new user I can't assing an organization to the new user. 

guess directoryId is the thing I'm looking for. 

If it is, how can I learn directoryId's of the organizations ?

Regards

Hüseyin

1 answer

0 votes
Mohamed Benziane
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 10, 2018

Hi Hüseyin,

Here a documentation about organisation and API, you can try to call /rest/servicedeskapi/organization, this will give you all organization with their names and ID's. 

You can use the JSON library to deal with the content you'll receive.

Hope it helps

 

Regards

Suggest an answer

Log in or Sign up to answer