jira: log error messages in "errors" key (#311)

Jira's API can return a empty "errorMessages" list, and the real error
is in the "errors" object. This happens, for example, if a user tries to
file a ticket in a project that does not exist (tested with Jira
v7.13.8)

Check both "errorMessages" and "errors", and report both values with
fail_json().

Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>

Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
This commit is contained in:
Ken Dreyer 2020-07-27 23:59:33 -06:00 committed by GitHub
commit 041824b98e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 3 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- jira - improve error message handling (https://github.com/ansible-collections/community.general/pull/311).