diff options
Diffstat (limited to 'server/sonar-web/src/main/js/helpers/sonarlint.ts')
-rw-r--r-- | server/sonar-web/src/main/js/helpers/sonarlint.ts | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/server/sonar-web/src/main/js/helpers/sonarlint.ts b/server/sonar-web/src/main/js/helpers/sonarlint.ts index a9c378d491e..b4d9dbccd33 100644 --- a/server/sonar-web/src/main/js/helpers/sonarlint.ts +++ b/server/sonar-web/src/main/js/helpers/sonarlint.ts @@ -55,13 +55,22 @@ export function openHotspot(calledPort: number, projectKey: string, hotspotKey: return fetch(showUrl.toString()).then((response: Response) => checkStatus(response, true)); } -export function openIssue(calledPort: number, projectKey: string, issueKey: string) { +export function openIssue( + calledPort: number, + projectKey: string, + issueKey: string, + branchName?: string, +) { const showUrl = new URL(buildSonarLintEndpoint(calledPort, '/issues/show')); showUrl.searchParams.set('server', getHostUrl()); showUrl.searchParams.set('project', projectKey); showUrl.searchParams.set('issue', issueKey); + if (branchName !== undefined) { + showUrl.searchParams.set('branch', branchName); + } + return fetch(showUrl.toString()).then((response: Response) => checkStatus(response, true)); } |