Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exception when listing customfield of type multiuser #78

Open
ckhan opened this issue Apr 8, 2019 · 0 comments
Open

exception when listing customfield of type multiuser #78

ckhan opened this issue Apr 8, 2019 · 0 comments

Comments

@ckhan
Copy link

ckhan commented Apr 8, 2019

If a custom field is of type multi user picker, then attempting to list that field will result in an exception:

$ jira-cli view --format '%key;%customfield_11201' BUG-2015
Traceback (most recent call last):
  File "/usr/bin/jira-cli", line 11, in <module>
    load_entry_point('jira-cli==2.2', 'console_scripts', 'jira-cli')()
  File "/usr/lib/python/jiracli/interface.py", line 272, in cli
    return post_args.cmd(jira, post_args).execute()
  File "/usr/lib/python/jiracli/processor.py", line 30, in execute
    return self.eval()
  File "/usr/lib/python/jiracli/processor.py", line 75, in eval
    comments_only=self.args.comments_only
  File "/usr/lib/python/jiracli/bridge/__init__.py", line 68, in format_issue
    ret_str = ret_str.replace(k, issue.setdefault(v.lower(),"")).encode('utf-8')
TypeError: expected a string or other character buffer object

The behavior I'd like to see is detect that the field is a list of users, and concatenate the displayName property of each into a comma-separated list:

BUG-2015;Jane Doe,John Smith

Ugly hack I used to workaround this, in case useful to others before proper support added:

replaceValue = issue.setdefault(v.lower(),"")
if type(replaceValue) == list:
    replaceValue = ",".join(d.displayName for d in replaceValue)
ret_str = ret_str.replace(k, replaceValue).encode('utf-8')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant