-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add assigneeName to issue assigned activities (#85554)
Originally written by: @gabriellanata; It supersedes: #85399 > When an issue is assigned to a team, the activity only shows the team ID which is not very visual. I'm adding assigneeName (which matches the `assignedTo` when requesting an issue's details) to activity data. If you visit [this URL](https://us.sentry.io/api/0/organizations/sentry/issues/4704765109/activities/) you can see the current format of the activity (trimmed data): ``` { "activity": [ { "type": "assigned", "data": { "assignee": "2006237", "assigneeEmail": null, "assigneeType": "team" } } ] } ``` The `issues` team is not mentioned in the API, however, the UI handles it well: <img width="309" alt="image" src="https://github.com/user-attachments/assets/fbe76b20-ad50-40a8-b32c-35189a44ed39" /> Ideally, we would store less information in `data` and make the serializer smarter by fetching the models it is indirectly referring to (see [code](https://github.com/getsentry/sentry/blob/e96e32a095e1e2ff89c8fb0ea2681848decaf4c3/src/sentry/models/activity.py#L57-L66)).
- Loading branch information
Showing
8 changed files
with
50 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ def get_activity(self, request: AuthenticatedHttpRequest, event): | |
"data": { | ||
"assignee": "10000000", | ||
"assigneeEmail": "[email protected]", | ||
"assigneeName": "Example User", | ||
"assigneeType": "user", | ||
}, | ||
} | ||
|
@@ -25,6 +26,7 @@ def get_activity(self, request: AuthenticatedHttpRequest, event): | |
"data": { | ||
"assignee": str(request.user.id), | ||
"assigneeEmail": request.user.email, | ||
"assigneeName": request.user.name, | ||
"assigneeType": "user", | ||
}, | ||
} | ||
|
@@ -35,5 +37,10 @@ def get_activity(self, request: AuthenticatedHttpRequest, event): | |
return { | ||
"type": ActivityType.ASSIGNED.value, | ||
"user_id": request.user.id, | ||
"data": {"assignee": "1", "assigneeEmail": None, "assigneeType": "team"}, | ||
"data": { | ||
"assignee": "1", | ||
"assigneeEmail": None, | ||
"assigneeName": "example-team", | ||
"assigneeType": "team", | ||
}, | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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