Skip to content

feat(user feedback): update default title for tickets created from user feedback #94889

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

jas-kas
Copy link
Member

@jas-kas jas-kas commented Jul 3, 2025

For external issues, the current default title "User Feedback" is generic and lacks context when integrated with external systems like JIRA, GitHub, or Linear.

This PR updates the issue title to contain the first few words of the feedback message (by default, first 10 words).

Fixes #76156

- Replace hardcoded 'User Feedback' title with dynamic generation
- Add generate_feedback_title() function that creates titles like 'User Feedback: [first few words]...'
- Handle edge cases: empty messages, long messages, special characters
- Add comprehensive tests for title generation functionality
- Maintain backwards compatibility - only affects new feedback issues
- Supports external integrations (JIRA, GitHub, Linear) with better context
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Jul 3, 2025

This comment was marked as off-topic.

@michellewzhang michellewzhang marked this pull request as ready for review July 7, 2025 23:00
@michellewzhang michellewzhang requested a review from a team as a code owner July 7, 2025 23:00
@michellewzhang
Copy link
Member

one thing to note is rely on the "user feedback" title string on the frontend in our breadcrumbs to identify feedback issue breadcrumbs, so if this gets merged we need to update this:

// Feedback frame
if (e.title === 'User Feedback') {
const time = new Date(e.timestamp);
invariant(isValidDate(time), 'feedbackFrame.timestamp is invalid');
feedbackFrames.push({
category: 'feedback',
data: {
eventId: e.id,
groupId: e['issue.id'],
groupShortId: e.issue,
label:
(Array.isArray(e['error.type']) ? e['error.type'][0] : e['error.type']) ??
'',
labels: toArray(e['error.type']).filter(Boolean),
projectSlug: e['project.name'],
},
message: e.title,
offsetMs: Math.abs(time.getTime() - startTimestampMs),
timestamp: time,
timestampMs: time.getTime(),
type: 'user', // For compatibility reasons. See BreadcrumbType
});
return;
}
// Error frame
const time = new Date(e.timestamp);
invariant(isValidDate(time), 'errorFrame.timestamp is invalid');
errorFrames.push({
category: 'issue' as const,
data: {
eventId: e.id,
groupId: e['issue.id'],
groupShortId: e.issue,
label:
(Array.isArray(e['error.type']) ? e['error.type'][0] : e['error.type']) ?? '',
labels: toArray(e['error.type']).filter(defined),
projectSlug: e['project.name'],
},
message: e.title,
offsetMs: Math.abs(time.getTime() - startTimestampMs),
timestamp: time,
timestampMs: time.getTime(),
type: 'error', // For compatibility reasons. See BreadcrumbType
});
} catch (error) {
Sentry.captureException(error);
}

Comment on lines 1185 to 1188
@django_db_all
def test_create_feedback_issue_uses_generated_title(
default_project, mock_produce_occurrence_to_kafka
):
Copy link
Member

Choose a reason for hiding this comment

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

I think we can delete this test because other tests should pickup the title change and need to be fixed up

it's suspicious that they're not failing though.

Copy link
Member

@michellewzhang michellewzhang Jul 8, 2025

Choose a reason for hiding this comment

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

i think it's valuable to test the method still to verify its behavior is as intended

Copy link
Member

Choose a reason for hiding this comment

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

we would have to add tests further down the issue creation pipeline, but i doubt any tests exist right now to check specifically for the title of feedback issues

Copy link
Member

Choose a reason for hiding this comment

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

other tests don't check the issue_title field, i think including this one makes sense

@jas-kas
Copy link
Member Author

jas-kas commented Jul 8, 2025

@aliu39 can you help clean up tests for this feature? 🙏 more context here on Slack

@michellewzhang michellewzhang force-pushed the cursor/update-user-feedback-ticket-title-format-b7ca branch from d1d6970 to 5590ebc Compare July 8, 2025 21:17
@michellewzhang michellewzhang requested a review from a team as a code owner July 8, 2025 21:17
@michellewzhang michellewzhang merged commit e55db77 into master Jul 8, 2025
63 checks passed
@michellewzhang michellewzhang deleted the cursor/update-user-feedback-ticket-title-format-b7ca branch July 8, 2025 22:00
andrewshie-sentry pushed a commit that referenced this pull request Jul 14, 2025
…er feedback (#94889)

For external issues, the current default title "User Feedback" is
generic and lacks context when integrated with external systems like
JIRA, GitHub, or Linear.

This PR updates the issue title to contain the first few words of the
feedback message (by default, first 10 words).

Fixes #76156

---------

Co-authored-by: Cursor Agent <[email protected]>
Co-authored-by: getsantry[bot] <66042841+getsantry[bot]@users.noreply.github.com>
Co-authored-by: Michelle Zhang <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scope: Backend Automatically applied to PRs that change backend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow customization on User Feedback automatic Jira issue creation.
5 participants