From 0c3e424ef1fc389f08fdf8aa9b8867eb0bfb316f 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 ff7cfb4d4..ff70b2ccc 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]))