MCPcopy Create free account
hub / github.com/getsentry/sentry / escapeIssueTagKey

Function escapeIssueTagKey

static/app/utils/queryString.tsx:177–197  ·  view source on GitHub ↗
(key: string)

Source from the content-addressed store, hash-verified

175 * If a tag conflicts with a reserved keyword, change it to `tags[key]:value`
176 */
177export function escapeIssueTagKey(key: string) {
178 if (key === '') {
179 return '""';
180 }
181
182 // Environment and project should be handled by the page filter
183 if (key === 'environment' || key === 'project') {
184 return key;
185 }
186
187 // Reserved keywords that conflict with issue search query
188 if (['project.name', 'project_id'].includes(key)) {
189 return `tags[${key}]`;
190 }
191
192 if (ISSUE_EVENT_FIELDS_THAT_MAY_CONFLICT_WITH_TAGS.has(key as FieldKey)) {
193 return `tags[${key}]`;
194 }
195
196 return key;
197}
198
199export function generateQueryWithTag(prevQuery: Query, tag: EventTag): Query {
200 const query = {...prevQuery};

Callers 4

EventTagsTreeRowDropdownFunction · 0.90
renameConflictingTagsFunction · 0.90
TagValueActionsMenuFunction · 0.90

Calls 1

hasMethod · 0.45

Tested by

no test coverage detected