Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jpavlav sorry one more thing i just noticed before I was about to merge... somehow 3.3.0 falls after 3.2.3 in the changelog. Can you please fix? Otherwise lgtm

- 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)

Expand Down
29 changes: 29 additions & 0 deletions actions/search_users.py
Original file line number Diff line number Diff line change
@@ -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
31 changes: 31 additions & 0 deletions actions/search_users.yaml
Original file line number Diff line number Diff line change
@@ -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: false
default: true
include_inactive:
type: boolean
description: True to include inactive users.
required: false
default: false
2 changes: 1 addition & 1 deletion pack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ keywords:
- issues
- ticket management
- project management
version: 3.2.3
version: 3.3.0
python_versions:
- "3"
author: StackStorm, Inc.
Expand Down
Loading