From bbdafb84132726fd81b0be804936e3f387884de8 Mon Sep 17 00:00:00 2001 From: Justin Palmer Date: Tue, 27 Jan 2026 07:21:36 -0600 Subject: [PATCH 1/3] Add `search_user` Action This PR includes the `search_users` action. --- CHANGES.md | 3 +++ actions/search_users.py | 29 +++++++++++++++++++++++++++++ actions/search_users.yaml | 31 +++++++++++++++++++++++++++++++ pack.yaml | 2 +- 4 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 actions/search_users.py create mode 100644 actions/search_users.yaml diff --git a/CHANGES.md b/CHANGES.md index 48d2f08..013bf5e 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,6 +3,9 @@ ## 3.2.3 - Addresses [#87](https://github.com/StackStorm-Exchange/stackstorm-jira/issues/87) JIRA sensor failure due to [deprecation of /v2/search endpoint](https://developer.atlassian.com/changelog/#CHANGE-2046) +# 3.3.0 +- Added new ``search_users`` action + ## 3.2.2 - Addresses [#87](https://github.com/StackStorm-Exchange/stackstorm-jira/issues/87) search failure due to [deprecation of /v2/search endpoint](https://developer.atlassian.com/changelog/#CHANGE-2046) diff --git a/actions/search_users.py b/actions/search_users.py new file mode 100644 index 0000000..c2e6bdf --- /dev/null +++ b/actions/search_users.py @@ -0,0 +1,29 @@ +from __future__ import annotations + +from lib.base import BaseJiraAction + +__all__ = ["SearchJiraUsersAction"] + + +class SearchJiraUsersAction(BaseJiraAction): + def run( + self, + query, + start_at: int = 0, + max_results: int = 50, + include_active: bool = True, + include_inactive: bool = False, + ) -> dict[str, str]: + users = self._client.search_users( + query=query, + startAt=start_at, + maxResults=max_results, + includeActive=include_active, + includeInactive=include_inactive, + ) + results = [] + + for user in users: + results.append(user.raw) + + return results diff --git a/actions/search_users.yaml b/actions/search_users.yaml new file mode 100644 index 0000000..aedae36 --- /dev/null +++ b/actions/search_users.yaml @@ -0,0 +1,31 @@ +--- +name: search_users +runner_type: python-script +description: Search JIRA users with a query +enabled: true +entry_point: search_users.py +parameters: + query: + type: string + description: Query string. Can be something like an email. + required: true + start_at: + type: integer + description: Offset for pagination + required: false + default: 0 + max_results: + type: integer + description: Maximum number of returned results + default: 50 + required: false + include_active: + type: boolean + description: True to include active users. + required: true + default: true + include_inactive: + type: boolean + description: True to include inactive users. + required: true + default: false diff --git a/pack.yaml b/pack.yaml index 110255d..b27e9db 100644 --- a/pack.yaml +++ b/pack.yaml @@ -6,7 +6,7 @@ keywords: - issues - ticket management - project management -version: 3.2.3 +version: 3.3.0 python_versions: - "3" author: StackStorm, Inc. From 07656db0c8a30b44c0310c7cd9647fbbd31ba345 Mon Sep 17 00:00:00 2001 From: Justin Palmer Date: Thu, 29 Jan 2026 10:54:34 -0600 Subject: [PATCH 2/3] Review Feedback Make Params Not required (have defaults) --- actions/search_users.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/actions/search_users.yaml b/actions/search_users.yaml index aedae36..19e522f 100644 --- a/actions/search_users.yaml +++ b/actions/search_users.yaml @@ -22,10 +22,10 @@ parameters: include_active: type: boolean description: True to include active users. - required: true + required: false default: true include_inactive: type: boolean description: True to include inactive users. - required: true + required: false default: false From 659973f8ee133e67f77a150464419473328445cb Mon Sep 17 00:00:00 2001 From: Justin Palmer Date: Sat, 31 Jan 2026 20:07:55 -0600 Subject: [PATCH 3/3] Correct order of changes in CHANGES.md --- CHANGES.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 013bf5e..fa03559 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,11 +1,11 @@ # Change Log +# 3.3.0 +- Added new ``search_users`` action. Addresses [#90](https://github.com/StackStorm-Exchange/stackstorm-jira/issues/90) + ## 3.2.3 - Addresses [#87](https://github.com/StackStorm-Exchange/stackstorm-jira/issues/87) JIRA sensor failure due to [deprecation of /v2/search endpoint](https://developer.atlassian.com/changelog/#CHANGE-2046) -# 3.3.0 -- Added new ``search_users`` action - ## 3.2.2 - Addresses [#87](https://github.com/StackStorm-Exchange/stackstorm-jira/issues/87) search failure due to [deprecation of /v2/search endpoint](https://developer.atlassian.com/changelog/#CHANGE-2046)