Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -620,10 +620,22 @@ export namespace Issue {
customFields: CustomFieldValue.CustomFieldValue[];
attachments: File.IssueFileInfo[];
sharedFiles: Project.SharedFile[];
externalFileLinks: ExternalFileLink[];
stars: Star.Star[];
childIssueSummary?: ChildIssueSummary;
}

export interface ExternalFileLink {
id: number;
serviceType: string;
name: string;
url: string;
createdUser?: User.User;
created: string;
updatedUser?: User.User;
updated: string;
}

export interface ChildIssueSummary {
total: number;
closed: number;
Expand Down
35 changes: 35 additions & 0 deletions test/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,41 @@ describe("Backlog API", () => {
expect(data.childIssueSummary).toEqual({ total: 3, closed: 1 });
});

it("should get a single issue with externalFileLinks.", async () => {
const externalFileLink = {
id: 10,
serviceType: "googledrive",
name: "spec.pdf",
url: "https://drive.google.com/file/d/xxxx/view",
createdUser: null,
created: "2026-07-28T00:00:00Z",
updatedUser: null,
updated: "2026-07-28T00:00:00Z",
};
const issue = {
id: 1,
projectId: 1,
issueKey: "TEST-1",
keyId: 1,
summary: "with external file link",
sharedFiles: [],
externalFileLinks: [externalFileLink],
};
mockRequest({
method: "GET",
path: "/api/v2/issues/TEST-1",
query: { apiKey },
status: 200,
data: issue,
times: 1,
});
const data = await backlog.getIssue("TEST-1");
expect(data).toEqual(issue);
expect(data.externalFileLinks).toHaveLength(1);
expect(data.externalFileLinks[0].serviceType).toBe("googledrive");
expect(data.externalFileLinks[0].url).toBe(externalFileLink.url);
});

it("should serialize the expand parameter using bracket array format.", () => {
const query = (backlog as any).toQueryString({
parentChild: backlogjs.Option.Issue.ParentChildType.GrandchildOnly,
Expand Down