1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-04-21 19:29:05 +00:00
community.general/plugins
patchback[bot] be4cf3ba4d
[PR #11735/3e9689b1 backport][stable-12] jira - resolve Cloud assignee email to account ID via user search (#11891)
jira - resolve Cloud assignee email to account ID via user search (#11735)

* jira - resolve Cloud assignee email to account ID via user search

When cloud=true and assignee contains '@', look up a unique user with
GET /rest/api/2/user/search and use accountId for create, transition,
and edit. Document Jira Cloud vs Server/Data Center assignee behavior.

Fixes https://github.com/ansible-collections/community.general/issues/11734

Assisted-by AI: Claude 4.6 Opus (Anthropic) via Cursor IDE



* * Using urllib.parse.quote for URL encoding
* Adding "added in version" note for assignee when resolving account_id from email



* * Added cached variable 'user_email'
* Changed comparison to handle missing email safely
* Updated error message formatting to use repr-style values



* jira - adjust assignee and cloud descriptions (#11734)



* jira - resolve user-type field emails to account IDs on Jira Cloud (#11734)

When cloud=true, user-type fields (assignee, reporter, and any listed
in the new custom_user_fields parameter) that contain '@' are resolved
from email to Jira Cloud account ID via the user search API. Strings
without '@' are assumed to be account IDs. Add custom_user_fields
parameter for user to declare additional custom fields of user type.



* jira - address PR 11735 review (docs, assignee path, errors, naming)

- Clarify O(custom_user_fields): built-ins stay automatic; list extra
  user-typed fields without implying they are only custom-field IDs.
- On Jira Cloud, set assignee from the module param as a plain string and
  let resolve_user_fields() map it to accountId (including email lookup).
- Drop redundant ``or []`` when merging O(custom_user_fields) with the
  built-in user field list.
- Use public names USER_FIELDS, resolve_user_fields, and resolve_account_id
  (no leading underscore) per reviewer preference.
- Quote field name and email in resolution errors with explicit "…" text
  instead of repr-style !r, keeping values readable in failure messages.

Refs: https://github.com/ansible-collections/community.general/pull/11735

AI-assisted: Composer 2 (Anthropic) via Cursor IDE



* Changing fail_json formatting



* formatting fixes



* jira - fixing assignee as module option in description



---------


(cherry picked from commit 3e9689b13d)

Signed-off-by: Vladimir Vasilev <vvasilev@redhat.com>
Co-authored-by: vladi-k <53343355+vladi-k@users.noreply.github.com>
2026-04-20 09:36:05 +02:00
..
action [PR #11400/236b9c0e backport][stable-12] Sort imports with ruff check --fix (#11409) 2026-01-09 19:36:52 +01:00
become [PR #11771/df252e5f backport][stable-12] incus, machinectl, run0 - fix become over pty connections (#11827) 2026-04-15 22:01:06 +02:00
cache [PR #11400/236b9c0e backport][stable-12] Sort imports with ruff check --fix (#11409) 2026-01-09 19:36:52 +01:00
callback [PR #11656/4dad53ab backport][stable-12] counter_enabled callback: honor display_ok_hosts setting (#11667) 2026-03-23 20:34:43 +01:00
connection [PR #11771/df252e5f backport][stable-12] incus, machinectl, run0 - fix become over pty connections (#11827) 2026-04-15 22:01:06 +02:00
doc_fragments [PR #11462/ce7cb4e9 backport][stable-12] New module icinga2_downtime (#11532) 2026-02-23 06:17:51 +01:00
filter [PR #11567/9b72d954 backport][stable-12] Add missing __future__ imports (#11569) 2026-03-11 07:10:34 +01:00
inventory [PR #11573/f9e583da backport][stable-12] fix: remove HTTPStatus constructs introduced in Python 3.11 (#11575) 2026-03-12 20:59:26 +01:00
lookup [PR #11817/175808d9 backport][stable-12] consul_kv: add ca_path option for custom CA certificate (#11852) 2026-04-17 18:33:02 +02:00
module_utils [PR #11887/9f80d89f backport][stable-12] lvol - migrate to CmdRunner (#11890) 2026-04-20 09:35:47 +02:00
modules [PR #11735/3e9689b1 backport][stable-12] jira - resolve Cloud assignee email to account ID via user search (#11891) 2026-04-20 09:36:05 +02:00
plugin_utils [PR #11567/9b72d954 backport][stable-12] Add missing __future__ imports (#11569) 2026-03-11 07:10:34 +01:00
test [PR #11400/236b9c0e backport][stable-12] Sort imports with ruff check --fix (#11409) 2026-01-09 19:36:52 +01:00