feat(aci): Add created_by search filter to workflow index endpoint#112873
Merged
feat(aci): Add created_by search filter to workflow index endpoint#112873
Conversation
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Negated list filter silently ignored for
created_by- Added 'NOT IN' to the operator match pattern and updated the condition to exclude() for both '!=' and 'NOT IN' operators, fixing the silent ignore of negated list filters.
Or push these changes by commenting:
@cursor push 8783d188f7
Preview (8783d188f7)
diff --git a/src/sentry/workflow_engine/endpoints/organization_workflow_index.py b/src/sentry/workflow_engine/endpoints/organization_workflow_index.py
--- a/src/sentry/workflow_engine/endpoints/organization_workflow_index.py
+++ b/src/sentry/workflow_engine/endpoints/organization_workflow_index.py
@@ -176,7 +176,9 @@
"workflowdataconditiongroup__condition_group__dataconditiongroupaction__action__type",
distinct=True,
)
- case SearchFilter(key=SearchKey("created_by"), operator=("=" | "IN" | "!=")):
+ case SearchFilter(
+ key=SearchKey("created_by"), operator=("=" | "IN" | "!=" | "NOT IN")
+ ):
values = (
filter.value.value
if isinstance(filter.value.value, list)
@@ -184,7 +186,7 @@
)
user_ids = [parse_user_value(v, request.user).id for v in values]
created_by_q = Q(created_by_id__in=user_ids)
- if filter.operator == "!=":
+ if filter.operator in ("!=", "NOT IN"):
queryset = queryset.exclude(created_by_q)
else:
queryset = queryset.filter(created_by_q)
diff --git a/tests/sentry/workflow_engine/endpoints/test_organization_workflow_index.py b/tests/sentry/workflow_engine/endpoints/test_organization_workflow_index.py
--- a/tests/sentry/workflow_engine/endpoints/test_organization_workflow_index.py
+++ b/tests/sentry/workflow_engine/endpoints/test_organization_workflow_index.py
@@ -548,6 +548,18 @@
str(self.workflow_two.id),
}
+ def test_query_by_created_by_negation_multiple(self) -> None:
+ other_user = self.create_user(email="other@example.com")
+ self.workflow.update(created_by_id=self.user.id)
+ self.workflow_two.update(created_by_id=other_user.id)
+
+ response = self.get_success_response(
+ self.organization.slug,
+ qs_params={"query": f"!created_by:[{self.user.email},{other_user.email}]"},
+ )
+ assert len(response.data) == 1
+ assert response.data[0]["id"] == str(self.workflow_three.id)
+
def test_query_by_created_by_invalid_user(self) -> None:
self.workflow.update(created_by_id=self.user.id)
response = self.get_success_response(This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 0788019. Configure here.
Support filtering workflows by creator using the query parameter (e.g. created_by:me, created_by:user@example.com). Supports =, !=, and IN operators, matching the pattern used for assignee filtering in the detector index endpoint.
0788019 to
ad79cb8
Compare
wedamija
approved these changes
Apr 13, 2026
saponifi3d
approved these changes
Apr 13, 2026
malwilley
added a commit
that referenced
this pull request
Apr 14, 2026
Add frontend support for the created_by search filter in the automations list, following the same pattern as the detector search assignee filter. Refactor filter key definitions into a useAutomationFilterKeys hook that provides dynamic member values for the created_by dropdown. Refs #112873
malwilley
added a commit
that referenced
this pull request
Apr 14, 2026
Add frontend support for the created_by search filter in the automations list, following the same pattern as the detector search assignee filter. Refactor filter key definitions into a useAutomationFilterKeys hook that provides dynamic member values for the created_by dropdown. Refs #112873
malwilley
added a commit
that referenced
this pull request
Apr 14, 2026
Add frontend support for the created_by search filter in the automations list, following the same pattern as the detector search assignee filter. Refactor filter key definitions into a useAutomationFilterKeys hook that provides dynamic member values for the created_by dropdown. Refs #112873
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Ref ISWF-2448
The workflow index endpoint already supports filtering by
nameandactionin the query parameter, but there's no way to filter by who created the workflow. This logic works similarly to the assignee filter in the detector_index endpointThis uses
parse_user_valuefrom the existing search utils to resolve values likeme(current user) or an email/username to a user ID, then filters oncreated_by_id. Supports=,!=, andINoperators (e.g.created_by:me,!created_by:user@example.com,created_by:[user1,user2]).