diff --git a/changelogs/fragments/707-jira-error-handling.yaml b/changelogs/fragments/707-jira-error-handling.yaml new file mode 100644 index 0000000000..23f4ac2629 --- /dev/null +++ b/changelogs/fragments/707-jira-error-handling.yaml @@ -0,0 +1,2 @@ +bugfixes: +- jira - improve error message handling with multiple errors (https://github.com/ansible-collections/community.general/pull/707). diff --git a/plugins/modules/web_infrastructure/jira.py b/plugins/modules/web_infrastructure/jira.py index 9936439d52..e06a5cac77 100644 --- a/plugins/modules/web_infrastructure/jira.py +++ b/plugins/modules/web_infrastructure/jira.py @@ -314,9 +314,9 @@ def request(url, user, passwd, timeout, data=None, method=None): msg = [] for key in ('errorMessages', 'errors'): if error.get(key): - msg.append(error[key]) + msg.append(to_native(error[key])) if msg: - module.fail_json(msg=to_native(', '.join(msg))) + module.fail_json(msg=', '.join(msg)) else: module.fail_json(msg=to_native(error)) else: