Hello,
I'm trying to get the email address of project leads (owners) by using their account ID in a python script. The problem that I'm having is that I get a 401:
{'code': 401, 'message': 'Unauthorized; scope does not match'}So what I do is I start iterating over the project (space) roles by getting the roles using this URL (I use the tenant ID in the url, given that this is a scoped token):
roles_url = f"https://api.atlassian.com/ex/jira/{tenant_id}/rest/api/3/project/{project_key}/role/I access the project data using this url:
proj_url = f"https://api.atlassian.com/ex/jira/{tenant_id}/rest/api/3/project/{project_key}"So I have a 'lead' dictionary key and a so-called 'accountId' key within this 'lead' dictionary.
So the next thing I do is try to retrieve the email address of this account ID, but it seems that this token is not authorized or I'm not querying it correctly. The URL I'm using is:
user_email_url = f"https://api.atlassian.com/ex/jira/{tenant_id}/rest/api/3/user/email"To which I'm sending the lead accountID:
query = { 'accountId': proj_data['lead']['accountId']}The token permissions are:
read:account
read:jira-user
read:jira-work
Any ideas why this might not work?