Hello,
I am trying to get all users from the group jira-users from a hosted jira account.
This is a solution that i tried figuring ou t and which i also found within the community and on the when i googled my problem.
from jira import JIRA
from jira.exceptions import JIRAError
import datetime
import requests
from requests.auth import HTTPBasicAuth
import json
def All_Jira_Users():
users = jira.group_members("jira-users")
print(users)
When executing this, here is what i'm getting
Traceback (most recent call last):
File "d:/JIRA_KPI/venv/jiraKpi.py", line 178, in <module>
All_Jira_Users()
File "d:/JIRA_KPI/venv/jiraKpi.py", line 168, in All_Jira_Users
users = jira.group_members("jira-users").items
File "D:\JIRA_KPI\venv\lib\site-packages\jira\client.py", line 1011, in group_members
result[user['key']] = {'name': user['name'],
KeyError: 'name'
Thanks for your help
Does anyone know the answer? I am getting exactly the same problem.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, you need to update the client.py file.
For Anaconda, this is located here:
C:\ProgramData\Anaconda3\Lib\site-packages\jira\client.py
The latest version of Jira does not support the key "name" or "key", so change the code lines that start at line 1205 to:
for user in r["users"]["items"]:
result[user["accountId"]] = {
"fullname": user["displayName"],
"email": user.get("emailAddress", "hidden"),
"active": user["active"]
}
NOTE three changes:
1. Remove the line that says "name", since that is no longer available in the JSON feed from Atlassian. You can use "fullname" to reference a person's name.
2. Change "key" to "accountId" since "key" is also no longer available.
3. Remove the last comma at the end of the line "active": user["active"]
Save the changes back to the same folder and restart your python (or Jupyter if you use that) kernel before re-running your code.
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.