Skip to content

Commit c5af465

Browse files
Bug with fields model fixed (#125)
* #124 bug with fields model fixed * small test improvement * small test improvement
1 parent f3030df commit c5af465

File tree

10 files changed

+248
-85
lines changed

10 files changed

+248
-85
lines changed

package-lock.json

Lines changed: 53 additions & 60 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@
4646
"@types/node": "^15.0.2",
4747
"@types/oauth": "^0.9.1",
4848
"@types/sinon": "^10.0.0",
49-
"@typescript-eslint/eslint-plugin": "^4.22.1",
50-
"@typescript-eslint/parser": "^4.22.1",
51-
"dotenv": "^9.0.0",
52-
"eslint": "^7.25.0",
49+
"@typescript-eslint/eslint-plugin": "^4.23.0",
50+
"@typescript-eslint/parser": "^4.23.0",
51+
"dotenv": "^9.0.2",
52+
"eslint": "^7.26.0",
5353
"eslint-config-airbnb-typescript": "^12.3.1",
5454
"eslint-import-resolver-typescript": "^2.4.0",
5555
"eslint-plugin-import": "^2.22.1",

src/agile/models/issueBean.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,5 +229,5 @@ export interface IssueBean {
229229
};
230230
/** The versions of each field on the issue. */
231231
versionedRepresentations?: {};
232-
fields?: {};
232+
fields?: Record<string, any>; // TODO clarify
233233
}

src/version2/models/fields.ts

Lines changed: 55 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,70 @@ import { Priority } from './priority';
33
import { UserDetails } from './userDetails';
44
import { TimeTrackingDetails } from './timeTrackingDetails';
55
import { IssueTypeDetails } from './issueTypeDetails';
6+
import { Watchers } from './watchers';
7+
import { Component } from './component';
8+
import { Attachment } from './attachment';
9+
import { User } from './user';
10+
import { IssueBean } from './issueBean';
11+
import { Comment } from './comment';
12+
import { Votes } from './votes';
13+
import { Worklog } from './worklog';
614

715
/**
8-
* Key fields from the linked issue. */
16+
* Key fields from the linked issue.
17+
*/
918
export interface Fields {
19+
[key: string]: any;
20+
1021
/** The summary description of the linked issue. */
11-
summary?: string;
22+
summary: string;
1223
/** The status of the linked issue. */
13-
status?: StatusDetails[];
24+
status: StatusDetails;
1425
/** The priority of the linked issue. */
15-
priority?: Priority[];
26+
priority: Priority;
1627
/** The assignee of the linked issue. */
17-
assignee?: UserDetails[];
28+
assignee: UserDetails;
1829
/** The time tracking of the linked issue. */
19-
timetracking?: TimeTrackingDetails[];
30+
timetracking: TimeTrackingDetails;
2031
/** The type of the linked issue. */
2132
issuetype?: IssueTypeDetails;
2233
/** The type of the linked issue. */
23-
issueType?: IssueTypeDetails[];
34+
issueType?: IssueTypeDetails;
35+
36+
timespent?: any;
37+
fixVersions?: string[];
38+
aggregatetimespent?: any;
39+
resolution?: any;
40+
resolutiondate?: any;
41+
workratio?: number;
42+
issuerestriction?: {
43+
issuerestrictions: any;
44+
shouldDisplay: boolean;
45+
};
46+
lastViewed?: any;
47+
watches: Watchers;
48+
created: string;
49+
labels: string[];
50+
updated: string;
51+
components: Component[];
52+
timeoriginalestimate?: any;
53+
description?: string;
54+
attachment: Attachment[];
55+
creator: User;
56+
subtasks: IssueBean[];
57+
reporter: User;
58+
comment: {
59+
comments: Comment[];
60+
self: string;
61+
maxResults: number;
62+
total: number;
63+
startAt: number;
64+
};
65+
votes: Votes;
66+
worklog: {
67+
startAt: number;
68+
maxResults: number;
69+
total: number;
70+
worklogs: Worklog[];
71+
};
2472
}

src/version2/models/issueBean.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { Operations } from './operations';
33
import { IssueUpdateMetadata } from './issueUpdateMetadata';
44
import { PageOfChangelogs } from './pageOfChangelogs';
55
import { IncludedFields } from './includedFields';
6+
import { Fields } from './fields';
67

78
export interface IssueBean {
89
/** Expand options that include additional issue details in the response. */
@@ -32,5 +33,5 @@ export interface IssueBean {
3233
/** The versions of each field on the issue. */
3334
versionedRepresentations?: {};
3435
fieldsToInclude?: IncludedFields;
35-
fields?: {};
36+
fields: Fields;
3637
}

0 commit comments

Comments
 (0)