Files
community.general/plugins/modules
vladi-k 3e9689b13d 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

Signed-off-by: Vladimir Vasilev <vvasilev@redhat.com>

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

Signed-off-by: Vladimir Vasilev <vvasilev@redhat.com>

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

Signed-off-by: Vladimir Vasilev <vvasilev@redhat.com>

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

Signed-off-by: Vladimir Vasilev <vvasilev@redhat.com>

* 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.

Signed-off-by: Vladimir Vasilev <vvasilev@redhat.com>

* 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

Signed-off-by: Vladimir Vasilev <vvasilev@redhat.com>

* Changing fail_json formatting

Signed-off-by: Vladimir Vasilev <vvasilev@redhat.com>

* formatting fixes

Signed-off-by: Vladimir Vasilev <vvasilev@redhat.com>

* jira - fixing assignee as module option in description

Signed-off-by: Vladimir Vasilev <vvasilev@redhat.com>

---------

Signed-off-by: Vladimir Vasilev <vvasilev@redhat.com>
2026-04-20 09:28:01 +02:00
..
2026-03-04 19:11:45 +13:00
2026-03-04 19:11:45 +13:00
2026-03-04 19:11:45 +13:00
2026-03-04 19:11:45 +13:00
2026-03-04 19:11:45 +13:00
2025-11-29 08:28:22 +01:00
2026-01-05 18:12:39 +01:00
2025-11-01 13:46:53 +01:00
2025-11-01 13:46:53 +01:00
2026-04-12 13:12:26 +02:00
2026-03-15 19:47:25 +01:00
2025-11-12 21:06:14 +01:00
2025-11-01 13:46:53 +01:00
2025-11-01 13:46:53 +01:00
2025-11-01 13:46:53 +01:00
2026-01-31 21:30:39 +13:00
2025-11-12 21:12:47 +01:00
2025-11-01 13:46:53 +01:00
2026-04-17 08:54:11 +02:00
2026-04-15 20:03:16 +02:00
2026-04-20 09:26:41 +02:00
2026-03-24 18:51:02 +13:00
2026-02-04 07:50:05 +01:00
2026-02-04 07:50:05 +01:00
2026-02-04 07:50:05 +01:00
2026-02-04 07:50:05 +01:00
2026-02-04 07:50:05 +01:00
2025-11-01 13:46:53 +01:00
2025-11-01 13:46:53 +01:00
2025-11-01 13:46:53 +01:00
2025-11-01 13:46:53 +01:00
2025-11-01 13:46:53 +01:00
2026-03-31 07:08:50 +02:00
2025-11-01 13:46:53 +01:00
2025-11-01 13:46:53 +01:00
2025-11-01 13:46:53 +01:00
2025-11-12 21:12:47 +01:00