Hey there,
I would be super glad if someone could point me to the right direction. Here is my issue.
Context: I'm working on a project that involves integrating our internal applications with Atlassian's user management system. The primary goal is to retrieve email addresses of users from Atlassian to link them with other applications in our organization. To achieve this, I've been following the Atlassian User Management API documentation.
What I've Done So Far:
API Key and Setup:
admin.atlassian.com
under my organization's settings.Request Attempt:
/users/{account_id}/manage
endpoint to check user management permissions and eventually retrieve email addresses.403 Forbidden
response.Issue:
403 Forbidden
error. This suggests that there might be a permissions issue, but I'm unsure how to proceed. Error mentions that Caller must be a verified org admin. Does that mean there is a verification process to perform and a "simple" org admin does not suffice?My Questions:
Additional Context:
Thank you for your assistance!
Hello @adam_aczel
Welcome to the Atlassian community.
Can you show us the actual code you are using? Use asterisks to replace sensitive data like the api token and account id.
Hello @Trudy Claspill
Thanks for the welcome and getting back to me :)
I have set up calls to two different endpoints so far, tasks are executed by an Airflow DAG FYI.
If emails were returned via the first endpoint I wouldn't even need the second one. Below I post the code excerpts for the respective endpoints, excluding logs and post processing for brevity.
1.
def get_all_jira_users(email, token):
url = "https://towa-digital.atlassian.net/rest/api/3/users/search"
auth = HTTPBasicAuth(email, token)
headers = {
"Accept": "application/json"
}
all_users = []
start_at = 0
per_page = 100
while True:
params = {"startAt": start_at, "maxResults": per_page}
response = requests.get(url, headers=headers, auth=auth, params=params)
2.
def update_jira_users(account_id_list, token):
base_url = "https://api.atlassian.com/users"
headers = {
"Authorization": f"Bearer {token}",
"Accept": "application/json"
}
user_data = []
for account_id in account_id_list:
url = f"{base_url}/{account_id}/manage/profile"
response = requests.get(url, headers=headers)
response.raise_for_status()
user = response.json()
user_data.append(user)
return user_data
Thank you for your time!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey @Trudy Claspill
After a short break I'm back to this project. Is there a chance you could guide me to someone I should talk to regarding getting the e-mail addresses for our users in our space?
Thank you in advance!
Adam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @adam_aczel I also has similar use case, were you able to solve this issue ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No, we resorted to build a custom logic to match users based on first and last names. In the end it turned out that due to duplicate users in Jira we would have had to do an in-house logic anyways. Maybe creating a ticket with Atlassian support could be a way to go, but I did not bother. In case you do find out something please share with the rest of us :)
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.