From 8f87530a4cf72e9e7bdf897bc376a0f5d52353d8 Mon Sep 17 00:00:00 2001 From: Ivo Bellin Salarin Date: Sat, 15 May 2021 19:05:16 +0200 Subject: [PATCH] fix: group_members (#933) * fix: group_members Some attributes have become obsolete with the latest GDPR developments. Avoid client crashes trying to retrieve the members of a group. * chore: blacken --- jira/client.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/jira/client.py b/jira/client.py index 3bec116a0..5df0598d9 100644 --- a/jira/client.py +++ b/jira/client.py @@ -1216,11 +1216,14 @@ def group_members(self, group: str) -> OrderedDict: result = {} for user in r["users"]["items"]: - result[user["key"]] = { - "name": user["name"], - "fullname": user["displayName"], + result[user["id"]] = { + "name": user.get("name"), + "id": user.get("id"), + "accountId": user.get("accountId"), + "fullname": user.get("displayName"), "email": user.get("emailAddress", "hidden"), - "active": user["active"], + "active": user.get("active"), + "timezone": user.get("timezone"), } return OrderedDict(sorted(result.items(), key=lambda t: t[0]))