File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
src/plus/integrations/providers Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -217,7 +217,11 @@ export class LinearIntegration extends IssuesIntegration<IssuesCloudHostIntegrat
217217 _type : undefined | IssueOrPullRequestType ,
218218 ) : Promise < IssueOrPullRequest | undefined > {
219219 const issue = await this . getRawProviderIssue ( session , resource , id ) ;
220- return issue && toIssueShape ( issue , this ) ;
220+ const autolinkableIssue : ProviderIssue | undefined = issue && {
221+ ...issue ,
222+ url : this . getIssueAutolinkLikeUrl ( issue ) ,
223+ } ;
224+ return autolinkableIssue && toIssueShape ( autolinkableIssue , this ) ;
221225 }
222226 protected override async getProviderIssue (
223227 session : ProviderAuthenticationSession ,
@@ -259,4 +263,13 @@ export class LinearIntegration extends IssuesIntegration<IssuesCloudHostIntegrat
259263 return undefined ;
260264 }
261265 }
266+ private getIssueAutolinkLikeUrl ( issue : ProviderIssue ) : string | null {
267+ const url = issue . url ;
268+ if ( url == null ) return null ;
269+ const lastSegment = url . split ( '/' ) . pop ( ) ;
270+ if ( ! lastSegment || issue . number === lastSegment ) {
271+ return url ;
272+ }
273+ return url . substring ( 0 , url . length - lastSegment . length - 1 ) ;
274+ }
262275}
You can’t perform that action at this time.
0 commit comments