summaryrefslogtreecommitdiff
path: root/jira-widget
diff options
context:
space:
mode:
authorstreetturtle <streetturtle@users.noreply.github.com>2021-10-13 19:57:59 -0400
committerGitHub <noreply@github.com>2021-10-13 19:57:59 -0400
commit63f33ff9ed00be3e36356f2cc85dd8fdfe8e4d22 (patch)
tree1b853d6eb2d51aefa933580c811af3e7dca7100d /jira-widget
parent56b13ca8b1b337e738cf0bd12311d8529211ad07 (diff)
parent7ed2f250122454c57ec35183baf148633f02966f (diff)
Merge pull request #297 from dgrabla/hotfix/change_name_for_displayName
fix(jira): update field name to displayName on *.atlassian.com hosts
Diffstat (limited to 'jira-widget')
-rw-r--r--jira-widget/jira.lua13
1 files changed, 11 insertions, 2 deletions
diff --git a/jira-widget/jira.lua b/jira-widget/jira.lua
index e475246..45c632e 100644
--- a/jira-widget/jira.lua
+++ b/jira-widget/jira.lua
@@ -167,13 +167,22 @@ local function worker(user_args)
local cur_status = ''
for _, issue in ipairs(result.issues) do
- local path_to_avatar = HOME_DIR ..'/.cache/awmw/jira-widget/avatars/' .. issue.fields.assignee.name
+
+ local path_to_avatar = HOME_DIR ..'/.cache/awmw/jira-widget/avatars/' .. issue.fields.assignee.name or issue.fields.assignee.displayName
+ local name = ''
+ if issue.fields.assignee.name == nil then
+ name = issue.fields.assignee.displayName
+ else
+ name = issue.fields.assignee.name
+ end
+
+ local path_to_avatar = HOME_DIR ..'/.cache/awmw/jira-widget/avatars/' .. name
if not gfs.file_readable(path_to_avatar) then
spawn.easy_async(string.format(
DOWNLOAD_AVATAR_CMD,
HOME_DIR,
- issue.fields.assignee.name,
+ name,
issue.fields.assignee.avatarUrls['48x48']))
end