codeapp-js 0.3.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AI/codeapp.agent.md +105 -0
- package/AI/skills/connections/SKILL.md +47 -0
- package/AI/skills/dataverse/SKILL.md +99 -0
- package/AI/skills/environment-variables/SKILL.md +89 -0
- package/AI/skills/frontend-design/SKILL.md +34 -0
- package/AI/skills/jira/SKILL.md +81 -0
- package/AI/skills/office365-groups/SKILL.md +61 -0
- package/AI/skills/office365-outlook/SKILL.md +52 -0
- package/AI/skills/office365-users/SKILL.md +78 -0
- package/AI/skills/sharepoint/SKILL.md +77 -0
- package/AI/skills/sql/SKILL.md +85 -0
- package/AI/skills/start/SKILL.md +46 -0
- package/AI/skills/teams/SKILL.md +55 -0
- package/{examples/combined demo/.power/schemas/office365groups/office365groups.Schema.json → codeApp/.power/schemas/office365groups/office365groups.Schema.json} +2203 -2203
- package/codeApp/dist/codeapp.js +95 -1792
- package/codeApp/dist/connectors/azureKeyvault.js +459 -0
- package/codeApp/dist/connectors/jira.js +1247 -0
- package/codeApp/dist/connectors/office365groups.js +642 -0
- package/codeApp/dist/connectors/office365users.js +513 -0
- package/codeApp/dist/connectors/outlook.js +1393 -0
- package/{dev files/sharepoint.js → codeApp/dist/connectors/sharepoint.js} +239 -112
- package/codeApp/dist/connectors/sql.js +149 -0
- package/codeApp/dist/connectors/teams.js +280 -0
- package/codeApp/dist/power-apps-data.js +16 -2
- package/examples/{kanban → apps/kanban}/dist/dataverse.js +94 -94
- package/examples/{kanban → apps/kanban}/dist/environmentVar.js +55 -55
- package/examples/{kanban → apps/kanban}/dist/index.css +605 -605
- package/examples/{kanban → apps/kanban}/dist/index.html +21 -21
- package/examples/{kanban → apps/kanban}/dist/index.js +860 -860
- package/examples/{kanban → apps/kanban}/dist/office365groups.js +97 -97
- package/examples/apps/kanban/dist/office365users.js +451 -0
- package/examples/{kanban → apps/kanban}/dist/outlook.js +162 -162
- package/examples/{planning Poker/dist/power-apps-data.js → apps/kanban/dist/power-apps-data.js} +2953 -2953
- package/examples/{kanban → apps/kanban}/dist/sharepoint.js +435 -339
- package/examples/{kanban → apps/kanban}/power.config.json +35 -35
- package/examples/{planning Poker → apps/planning Poker}/additional files/customizations (tables).xml +6428 -6428
- package/examples/{planning Poker → apps/planning Poker}/additional files/dataverse-tables.json +165 -165
- package/examples/{planning Poker → apps/planning Poker}/additional files/readme.md +122 -122
- package/examples/{planning Poker → apps/planning Poker}/dist/dataverse.js +78 -78
- package/examples/{planning Poker → apps/planning Poker}/dist/index.html +198 -198
- package/examples/{planning Poker → apps/planning Poker}/dist/index.js +954 -954
- package/examples/{todo/dist/power-apps-data.js → apps/planning Poker/dist/power-apps-data.js } +2953 -2953
- package/examples/{planning Poker → apps/planning Poker}/dist/styles.css +815 -815
- package/examples/{planning Poker → apps/planning Poker}/power.config.json +50 -50
- package/examples/{outlook Demo2 → apps/solution explorer}/dist/codeapp.js +9 -245
- package/examples/apps/solution explorer/dist/index.html +80 -0
- package/examples/apps/solution explorer/dist/index.js +735 -0
- package/examples/apps/solution explorer/dist/styles.css +571 -0
- package/examples/apps/solution explorer/power.config.json +151 -0
- package/examples/{todo → apps/todo}/dist/dataverse.js +64 -64
- package/examples/{todo → apps/todo}/dist/index.html +75 -75
- package/examples/{todo → apps/todo}/dist/index.js +8 -8
- package/examples/{kanban → apps/todo}/dist/power-apps-data.js +2953 -2953
- package/examples/{todo → apps/todo}/dist/renderer.js +375 -375
- package/examples/{todo → apps/todo}/dist/styles.css +691 -691
- package/examples/{todo → apps/todo}/power.config.json +34 -34
- package/examples/combined demo/.power/schemas/appschemas/dataSourcesInfo.ts +6275 -7830
- package/examples/combined demo/.power/schemas/jira/jira.Schema.json +6903 -0
- package/examples/combined demo/.power/schemas/keyvault/keyvault.Schema.json +1600 -0
- package/examples/combined demo/.power/schemas/teams/teams.Schema.json +11112 -0
- package/examples/combined demo/dist/codeapp.js +394 -1098
- package/examples/{outlook Demo2/OutlookDemo_1_0_0_1.zip → combined demo/dist/icon-512.png} +0 -0
- package/examples/combined demo/dist/index.html +29 -511
- package/examples/combined demo/dist/index.js +490 -470
- package/examples/combined demo/dist/office365users.js +513 -0
- package/examples/combined demo/dist/outlook.js +1393 -0
- package/examples/combined demo/dist/power-apps-data.js +3079 -3006
- package/examples/combined demo/dist/styles.css +483 -0
- package/examples/combined demo/power.config.json +33 -42
- package/examples/combined demo/src/generated/index.ts +12 -14
- package/examples/combined demo/src/generated/models/AzureKeyVaultModel.ts +107 -0
- package/examples/combined demo/src/generated/models/JiraModel.ts +501 -0
- package/examples/combined demo/src/generated/services/AzureKeyVaultService.ts +257 -0
- package/examples/combined demo/src/generated/services/JiraService.ts +1124 -0
- package/examples/dataverse Demo/dist/codeapp.js +394 -1085
- package/examples/dataverse Demo/dist/icon-512.png +0 -0
- package/examples/dataverse Demo/dist/index.html +146 -54
- package/examples/dataverse Demo/dist/index.js +693 -83
- package/examples/dataverse Demo/dist/power-apps-data.js +3079 -2911
- package/examples/dataverse Demo/dist/styles.css +528 -0
- package/examples/dataverse Demo/power.config.json +41 -35
- package/examples/dataverse Demo/readme.md +79 -79
- package/examples/groups Demo/dist/codeapp.js +394 -1085
- package/examples/groups Demo/dist/icon-512.png +0 -0
- package/examples/groups Demo/dist/index.html +21 -25
- package/examples/groups Demo/dist/index.js +304 -113
- package/examples/groups Demo/dist/office365groups.js +642 -0
- package/examples/groups Demo/dist/power-apps-data.js +3079 -2911
- package/examples/groups Demo/dist/styles.css +509 -0
- package/examples/groups Demo/power.config.json +25 -25
- package/examples/myProfile/dist/codeapp.js +398 -0
- package/examples/myProfile/dist/index.html +21 -184
- package/examples/myProfile/dist/index.js +324 -141
- package/examples/myProfile/dist/office365users.js +517 -169
- package/examples/myProfile/dist/power-apps-data.js +3080 -2953
- package/examples/myProfile/dist/styles.css +458 -0
- package/examples/myProfile/power.config.json +24 -23
- package/examples/outlook Demo/dist/codeapp.js +394 -1085
- package/examples/outlook Demo/dist/index.html +150 -35
- package/examples/outlook Demo/dist/index.js +516 -170
- package/examples/outlook Demo/dist/outlook.js +1393 -121
- package/examples/outlook Demo/dist/power-apps-data.js +3079 -2911
- package/examples/outlook Demo/dist/styles.css +408 -84
- package/examples/outlook Demo/power.config.json +24 -23
- package/examples/outlook Demo/readme.md +92 -82
- package/examples/sharePoint Demo/dist/codeapp.js +394 -1085
- package/examples/sharePoint Demo/dist/icon-512.png +0 -0
- package/examples/sharePoint Demo/dist/index.html +22 -255
- package/examples/sharePoint Demo/dist/index.js +899 -262
- package/examples/sharePoint Demo/dist/power-apps-data.js +3079 -2911
- package/examples/sharePoint Demo/dist/sharepoint.js +466 -0
- package/examples/sharePoint Demo/dist/styles.css +587 -0
- package/examples/sharePoint Demo/power.config.json +23 -22
- package/package.json +1 -1
- package/readme.md +465 -76
- package/.vscode/settings.json +0 -6
- package/dev files/customConnector.js +0 -98
- package/dev files/dataverse.js +0 -120
- package/dev files/environmentVar.js +0 -55
- package/dev files/office365groups.js +0 -65
- package/dev files/office365users.js +0 -169
- package/dev files/outlook.js +0 -330
- package/dev files/power-apps-data.js +0 -2952
- package/examples/combined demo/.power/schemas/office365/office365.Schema.json +0 -21098
- package/examples/combined demo/.power/schemas/office365users/office365users.Schema.json +0 -2094
- package/examples/kanban/agent/decision-log.md +0 -9
- package/examples/kanban/agent/mockup-01-editorial-glass.html +0 -159
- package/examples/kanban/agent/mockup-02-dark-rail.html +0 -147
- package/examples/kanban/agent/mockup-03-paper-grid.html +0 -114
- package/examples/kanban/agent/mockup-04-neon-minimal.html +0 -141
- package/examples/kanban/agent/mockup-05-mono-architect.html +0 -119
- package/examples/kanban/dist/office365users.js +0 -169
- package/examples/kanban/src/generated/index.ts +0 -14
- package/examples/kanban/src/generated/models/Office365GroupsModel.ts +0 -363
- package/examples/kanban/src/generated/models/Office365OutlookModel.ts +0 -2046
- package/examples/kanban/src/generated/models/Office365UsersModel.ts +0 -254
- package/examples/kanban/src/generated/services/Office365GroupsService.ts +0 -326
- package/examples/kanban/src/generated/services/Office365OutlookService.ts +0 -2476
- package/examples/kanban/src/generated/services/Office365UsersService.ts +0 -358
- package/examples/outlook Demo2/agent/decision-log.md +0 -7
- package/examples/outlook Demo2/dist/index.html +0 -98
- package/examples/outlook Demo2/dist/index.js +0 -272
- package/examples/outlook Demo2/dist/styles.css +0 -639
- package/examples/outlook Demo2/power.config.json +0 -23
- package/examples/planning Poker/.vscode/settings.json +0 -5
- package/examples/sharePoint Demo/agent/decision-log.md +0 -17
- /package/examples/{outlook Demo2 → apps/kanban}/src/generated/index.ts +0 -0
- /package/examples/{outlook Demo2 → apps/kanban}/src/generated/models/Office365GroupsModel.ts +0 -0
- /package/examples/{outlook Demo2 → apps/kanban}/src/generated/models/Office365OutlookModel.ts +0 -0
- /package/examples/{outlook Demo2 → apps/kanban}/src/generated/models/Office365UsersModel.ts +0 -0
- /package/examples/{outlook Demo2 → apps/kanban}/src/generated/services/Office365GroupsService.ts +0 -0
- /package/examples/{outlook Demo2 → apps/kanban}/src/generated/services/Office365OutlookService.ts +0 -0
- /package/examples/{outlook Demo2 → apps/kanban}/src/generated/services/Office365UsersService.ts +0 -0
- /package/examples/{planning Poker → apps/planning Poker}/additional files/AgilePoker_1_0_0_1.zip +0 -0
- /package/examples/{planning Poker → apps/planning Poker}/additional files/PokerTables_1_0_0_1.zip +0 -0
- /package/examples/{outlook Demo2 → apps/solution explorer}/dist/icon-512.png +0 -0
- /package/examples/{outlook Demo2 → apps/solution explorer}/dist/power-apps-data.js +0 -0
- /package/examples/{todo → apps/todo}/dist/icon192.png +0 -0
|
@@ -0,0 +1,1247 @@
|
|
|
1
|
+
// ────────────────────────────────────────────────────────────────────────────
|
|
2
|
+
// ─────────────────────────────────── Jira ───────────────────────────────────
|
|
3
|
+
// ────────────────────────────────────────────────────────────────────────────
|
|
4
|
+
|
|
5
|
+
const JIRA_DATA_SOURCE_CANDIDATES = ["jira", "Jira", "JIRA"];
|
|
6
|
+
const JIRA_APIS = {
|
|
7
|
+
AddComment_V2: {
|
|
8
|
+
path: "/{connectionId}/v2/issue/{issueKey}/comment",
|
|
9
|
+
method: "POST",
|
|
10
|
+
parameters: [
|
|
11
|
+
{ name: "connectionId", in: "path", required: true },
|
|
12
|
+
{ name: "X-Request-Jirainstance", in: "header", required: true },
|
|
13
|
+
{ name: "issueKey", in: "path", required: true },
|
|
14
|
+
{ name: "body", in: "body", required: true },
|
|
15
|
+
],
|
|
16
|
+
},
|
|
17
|
+
CancelTask_V2: {
|
|
18
|
+
path: "/{connectionId}/v2/task/{taskId}/cancel",
|
|
19
|
+
method: "POST",
|
|
20
|
+
parameters: [
|
|
21
|
+
{ name: "connectionId", in: "path", required: true },
|
|
22
|
+
{ name: "X-Request-Jirainstance", in: "header", required: true },
|
|
23
|
+
{ name: "taskId", in: "path", required: true },
|
|
24
|
+
{ name: "X-Atlassian-Token", in: "header", required: true },
|
|
25
|
+
],
|
|
26
|
+
},
|
|
27
|
+
CreateIssue_V3: {
|
|
28
|
+
path: "/{connectionId}/v3/issue",
|
|
29
|
+
method: "POST",
|
|
30
|
+
parameters: [
|
|
31
|
+
{ name: "connectionId", in: "path", required: true },
|
|
32
|
+
{ name: "X-Request-Jirainstance", in: "header", required: true },
|
|
33
|
+
{ name: "projectKey", in: "query", required: true },
|
|
34
|
+
{ name: "issueTypeIds", in: "query", required: true },
|
|
35
|
+
{ name: "item", in: "body", required: false },
|
|
36
|
+
],
|
|
37
|
+
},
|
|
38
|
+
EditIssue_V2: {
|
|
39
|
+
path: "/{connectionId}/v2/3/issue/{issueIdOrKey}",
|
|
40
|
+
method: "PUT",
|
|
41
|
+
parameters: [
|
|
42
|
+
{ name: "connectionId", in: "path", required: true },
|
|
43
|
+
{ name: "X-Request-Jirainstance", in: "header", required: true },
|
|
44
|
+
{ name: "issueIdOrKey", in: "path", required: true },
|
|
45
|
+
{ name: "notifyUsers", in: "query", required: false },
|
|
46
|
+
{ name: "overrideScreenSecurity", in: "query", required: false },
|
|
47
|
+
{ name: "overrideEditableFlag", in: "query", required: false },
|
|
48
|
+
{ name: "body", in: "body", required: false },
|
|
49
|
+
],
|
|
50
|
+
},
|
|
51
|
+
GetCurrentUser: {
|
|
52
|
+
path: "/{connectionId}/3/myself",
|
|
53
|
+
method: "GET",
|
|
54
|
+
parameters: [
|
|
55
|
+
{ name: "connectionId", in: "path", required: true },
|
|
56
|
+
{ name: "X-Request-Jirainstance", in: "header", required: true },
|
|
57
|
+
{ name: "expand", in: "query", required: false },
|
|
58
|
+
],
|
|
59
|
+
},
|
|
60
|
+
GetIssue_V2: {
|
|
61
|
+
path: "/{connectionId}/v2/issue/{issueKey}",
|
|
62
|
+
method: "GET",
|
|
63
|
+
parameters: [
|
|
64
|
+
{ name: "connectionId", in: "path", required: true },
|
|
65
|
+
{ name: "X-Request-Jirainstance", in: "header", required: true },
|
|
66
|
+
{ name: "issueKey", in: "path", required: true },
|
|
67
|
+
],
|
|
68
|
+
},
|
|
69
|
+
ListFilters_V2: {
|
|
70
|
+
path: "/{connectionId}/v2/filter/search",
|
|
71
|
+
method: "GET",
|
|
72
|
+
parameters: [
|
|
73
|
+
{ name: "connectionId", in: "path", required: true },
|
|
74
|
+
{ name: "X-Request-Jirainstance", in: "header", required: true },
|
|
75
|
+
],
|
|
76
|
+
},
|
|
77
|
+
ListIssues: {
|
|
78
|
+
path: "/{connectionId}/2/search",
|
|
79
|
+
method: "GET",
|
|
80
|
+
parameters: [
|
|
81
|
+
{ name: "connectionId", in: "path", required: true },
|
|
82
|
+
{ name: "X-Request-Jirainstance", in: "header", required: true },
|
|
83
|
+
{ name: "jql", in: "query", required: false },
|
|
84
|
+
{ name: "expand", in: "query", required: false },
|
|
85
|
+
{ name: "fields", in: "query", required: false },
|
|
86
|
+
],
|
|
87
|
+
},
|
|
88
|
+
ListProjects_V2: {
|
|
89
|
+
path: "/{connectionId}/project/search",
|
|
90
|
+
method: "GET",
|
|
91
|
+
parameters: [
|
|
92
|
+
{ name: "connectionId", in: "path", required: true },
|
|
93
|
+
],
|
|
94
|
+
},
|
|
95
|
+
GetTask_V2: {
|
|
96
|
+
path: "/{connectionId}/v2/task/{taskId}",
|
|
97
|
+
method: "GET",
|
|
98
|
+
parameters: [
|
|
99
|
+
{ name: "connectionId", in: "path", required: true },
|
|
100
|
+
{ name: "X-Request-Jirainstance", in: "header", required: true },
|
|
101
|
+
{ name: "taskId", in: "path", required: true },
|
|
102
|
+
],
|
|
103
|
+
},
|
|
104
|
+
GetUser_V2: {
|
|
105
|
+
path: "/{connectionId}/v2/user",
|
|
106
|
+
method: "GET",
|
|
107
|
+
parameters: [
|
|
108
|
+
{ name: "connectionId", in: "path", required: true },
|
|
109
|
+
{ name: "X-Request-Jirainstance", in: "header", required: true },
|
|
110
|
+
{ name: "accountId", in: "query", required: true },
|
|
111
|
+
{ name: "expand", in: "query", required: false },
|
|
112
|
+
],
|
|
113
|
+
},
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
Object.assign(JIRA_APIS, {
|
|
117
|
+
EditIssue: {
|
|
118
|
+
path: "/{connectionId}/3/issue/{issueIdOrKey}",
|
|
119
|
+
method: "PUT",
|
|
120
|
+
parameters: [
|
|
121
|
+
{ name: "connectionId", in: "path", required: true },
|
|
122
|
+
{ name: "issueIdOrKey", in: "path", required: true },
|
|
123
|
+
{ name: "notifyUsers", in: "query", required: false },
|
|
124
|
+
{ name: "overrideScreenSecurity", in: "query", required: false },
|
|
125
|
+
{ name: "overrideEditableFlag", in: "query", required: false },
|
|
126
|
+
{ name: "body", in: "body", required: false },
|
|
127
|
+
],
|
|
128
|
+
},
|
|
129
|
+
DeleteProject: {
|
|
130
|
+
path: "/{connectionId}/3/project/{projectIdOrKey}",
|
|
131
|
+
method: "DELETE",
|
|
132
|
+
parameters: [
|
|
133
|
+
{ name: "connectionId", in: "path", required: true },
|
|
134
|
+
{ name: "projectIdOrKey", in: "path", required: true },
|
|
135
|
+
{ name: "enableUndo", in: "query", required: false },
|
|
136
|
+
],
|
|
137
|
+
},
|
|
138
|
+
UpdateProject: {
|
|
139
|
+
path: "/{connectionId}/3/project/{projectIdOrKey}",
|
|
140
|
+
method: "PUT",
|
|
141
|
+
parameters: [
|
|
142
|
+
{ name: "connectionId", in: "path", required: true },
|
|
143
|
+
{ name: "projectIdOrKey", in: "path", required: true },
|
|
144
|
+
{ name: "body", in: "body", required: false },
|
|
145
|
+
],
|
|
146
|
+
},
|
|
147
|
+
DeleteProject_V2: {
|
|
148
|
+
path: "/{connectionId}/v2/project/{projectIdOrKey}",
|
|
149
|
+
method: "DELETE",
|
|
150
|
+
parameters: [
|
|
151
|
+
{ name: "connectionId", in: "path", required: true },
|
|
152
|
+
{ name: "X-Request-Jirainstance", in: "header", required: true },
|
|
153
|
+
{ name: "projectIdOrKey", in: "path", required: true },
|
|
154
|
+
{ name: "enableUndo", in: "query", required: false },
|
|
155
|
+
],
|
|
156
|
+
},
|
|
157
|
+
UpdateProject_V2: {
|
|
158
|
+
path: "/{connectionId}/v2/project/{projectIdOrKey}",
|
|
159
|
+
method: "PUT",
|
|
160
|
+
parameters: [
|
|
161
|
+
{ name: "connectionId", in: "path", required: true },
|
|
162
|
+
{ name: "X-Request-Jirainstance", in: "header", required: true },
|
|
163
|
+
{ name: "projectIdOrKey", in: "path", required: true },
|
|
164
|
+
{ name: "body", in: "body", required: false },
|
|
165
|
+
],
|
|
166
|
+
},
|
|
167
|
+
GetAllProjectCategories: {
|
|
168
|
+
path: "/{connectionId}/3/projectCategory",
|
|
169
|
+
method: "GET",
|
|
170
|
+
parameters: [
|
|
171
|
+
{ name: "connectionId", in: "path", required: true },
|
|
172
|
+
],
|
|
173
|
+
},
|
|
174
|
+
CreateProjectCategory: {
|
|
175
|
+
path: "/{connectionId}/3/projectCategory",
|
|
176
|
+
method: "POST",
|
|
177
|
+
parameters: [
|
|
178
|
+
{ name: "connectionId", in: "path", required: true },
|
|
179
|
+
{ name: "body", in: "body", required: false },
|
|
180
|
+
],
|
|
181
|
+
},
|
|
182
|
+
GetAllProjectCategories_V2: {
|
|
183
|
+
path: "/{connectionId}/v2/projectCategory",
|
|
184
|
+
method: "GET",
|
|
185
|
+
parameters: [
|
|
186
|
+
{ name: "connectionId", in: "path", required: true },
|
|
187
|
+
{ name: "X-Request-Jirainstance", in: "header", required: true },
|
|
188
|
+
],
|
|
189
|
+
},
|
|
190
|
+
CreateProjectCategory_V2: {
|
|
191
|
+
path: "/{connectionId}/v2/projectCategory",
|
|
192
|
+
method: "POST",
|
|
193
|
+
parameters: [
|
|
194
|
+
{ name: "connectionId", in: "path", required: true },
|
|
195
|
+
{ name: "X-Request-Jirainstance", in: "header", required: true },
|
|
196
|
+
{ name: "body", in: "body", required: false },
|
|
197
|
+
],
|
|
198
|
+
},
|
|
199
|
+
RemoveProjectCategory: {
|
|
200
|
+
path: "/{connectionId}/3/projectCategory/{id}",
|
|
201
|
+
method: "DELETE",
|
|
202
|
+
parameters: [
|
|
203
|
+
{ name: "connectionId", in: "path", required: true },
|
|
204
|
+
{ name: "id", in: "path", required: true },
|
|
205
|
+
],
|
|
206
|
+
},
|
|
207
|
+
RemoveProjectCategory_V2: {
|
|
208
|
+
path: "/{connectionId}/v2/projectCategory/{id}",
|
|
209
|
+
method: "DELETE",
|
|
210
|
+
parameters: [
|
|
211
|
+
{ name: "connectionId", in: "path", required: true },
|
|
212
|
+
{ name: "X-Request-Jirainstance", in: "header", required: true },
|
|
213
|
+
{ name: "id", in: "path", required: true },
|
|
214
|
+
],
|
|
215
|
+
},
|
|
216
|
+
GetTask: {
|
|
217
|
+
path: "/{connectionId}/3/task/{taskId}",
|
|
218
|
+
method: "GET",
|
|
219
|
+
parameters: [
|
|
220
|
+
{ name: "connectionId", in: "path", required: true },
|
|
221
|
+
{ name: "taskId", in: "path", required: true },
|
|
222
|
+
],
|
|
223
|
+
},
|
|
224
|
+
CancelTask: {
|
|
225
|
+
path: "/{connectionId}/3/task/{taskId}/cancel",
|
|
226
|
+
method: "POST",
|
|
227
|
+
parameters: [
|
|
228
|
+
{ name: "connectionId", in: "path", required: true },
|
|
229
|
+
{ name: "taskId", in: "path", required: true },
|
|
230
|
+
{ name: "X-Atlassian-Token", in: "header", required: true },
|
|
231
|
+
],
|
|
232
|
+
},
|
|
233
|
+
GetUser: {
|
|
234
|
+
path: "/{connectionId}/3/user",
|
|
235
|
+
method: "GET",
|
|
236
|
+
parameters: [
|
|
237
|
+
{ name: "connectionId", in: "path", required: true },
|
|
238
|
+
{ name: "accountId", in: "query", required: true },
|
|
239
|
+
{ name: "expand", in: "query", required: false },
|
|
240
|
+
],
|
|
241
|
+
},
|
|
242
|
+
CreateIssue: {
|
|
243
|
+
path: "/{connectionId}/issue",
|
|
244
|
+
method: "POST",
|
|
245
|
+
parameters: [
|
|
246
|
+
{ name: "connectionId", in: "path", required: true },
|
|
247
|
+
{ name: "projectKey", in: "query", required: true },
|
|
248
|
+
{ name: "body", in: "body", required: true },
|
|
249
|
+
],
|
|
250
|
+
},
|
|
251
|
+
CreateIssueV2: {
|
|
252
|
+
path: "/{connectionId}/v2/issue",
|
|
253
|
+
method: "POST",
|
|
254
|
+
parameters: [
|
|
255
|
+
{ name: "connectionId", in: "path", required: true },
|
|
256
|
+
{ name: "projectKey", in: "query", required: true },
|
|
257
|
+
{ name: "issueTypeIds", in: "query", required: true },
|
|
258
|
+
{ name: "item", in: "body", required: false },
|
|
259
|
+
],
|
|
260
|
+
},
|
|
261
|
+
GetIssue: {
|
|
262
|
+
path: "/{connectionId}/issue/{issueKey}",
|
|
263
|
+
method: "GET",
|
|
264
|
+
parameters: [
|
|
265
|
+
{ name: "connectionId", in: "path", required: true },
|
|
266
|
+
{ name: "issueKey", in: "path", required: true },
|
|
267
|
+
],
|
|
268
|
+
},
|
|
269
|
+
UpdateIssue: {
|
|
270
|
+
path: "/{connectionId}/issue/{issueKey}",
|
|
271
|
+
method: "PUT",
|
|
272
|
+
parameters: [
|
|
273
|
+
{ name: "connectionId", in: "path", required: true },
|
|
274
|
+
{ name: "issueKey", in: "path", required: true },
|
|
275
|
+
{ name: "body", in: "body", required: true },
|
|
276
|
+
],
|
|
277
|
+
},
|
|
278
|
+
UpdateIssue_V2: {
|
|
279
|
+
path: "/{connectionId}/v2/issue/{issueKey}",
|
|
280
|
+
method: "PUT",
|
|
281
|
+
parameters: [
|
|
282
|
+
{ name: "connectionId", in: "path", required: true },
|
|
283
|
+
{ name: "X-Request-Jirainstance", in: "header", required: true },
|
|
284
|
+
{ name: "issueKey", in: "path", required: true },
|
|
285
|
+
{ name: "body", in: "body", required: true },
|
|
286
|
+
],
|
|
287
|
+
},
|
|
288
|
+
AddComment: {
|
|
289
|
+
path: "/{connectionId}/issue/{issueKey}/comment",
|
|
290
|
+
method: "POST",
|
|
291
|
+
parameters: [
|
|
292
|
+
{ name: "connectionId", in: "path", required: true },
|
|
293
|
+
{ name: "issueKey", in: "path", required: true },
|
|
294
|
+
{ name: "body", in: "body", required: true },
|
|
295
|
+
],
|
|
296
|
+
},
|
|
297
|
+
ListIssueTypes: {
|
|
298
|
+
path: "/{connectionId}/issue/createmeta",
|
|
299
|
+
method: "GET",
|
|
300
|
+
parameters: [
|
|
301
|
+
{ name: "connectionId", in: "path", required: true },
|
|
302
|
+
{ name: "projectKey", in: "query", required: true },
|
|
303
|
+
],
|
|
304
|
+
},
|
|
305
|
+
ListIssueTypes_V2: {
|
|
306
|
+
path: "/{connectionId}/v2/types/issue/createmeta",
|
|
307
|
+
method: "GET",
|
|
308
|
+
parameters: [
|
|
309
|
+
{ name: "connectionId", in: "path", required: true },
|
|
310
|
+
{ name: "X-Request-Jirainstance", in: "header", required: true },
|
|
311
|
+
{ name: "projectKey", in: "query", required: true },
|
|
312
|
+
],
|
|
313
|
+
},
|
|
314
|
+
ListIssueTypesFields: {
|
|
315
|
+
path: "/{connectionId}/v2/issue/createmeta",
|
|
316
|
+
method: "GET",
|
|
317
|
+
parameters: [
|
|
318
|
+
{ name: "connectionId", in: "path", required: true },
|
|
319
|
+
{ name: "projectKey", in: "query", required: true },
|
|
320
|
+
{ name: "issuetypeIds", in: "query", required: true },
|
|
321
|
+
],
|
|
322
|
+
},
|
|
323
|
+
ListIssueTypesFields_V2: {
|
|
324
|
+
path: "/{connectionId}/v3/issue/createmeta",
|
|
325
|
+
method: "GET",
|
|
326
|
+
parameters: [
|
|
327
|
+
{ name: "connectionId", in: "path", required: true },
|
|
328
|
+
{ name: "X-Request-Jirainstance", in: "header", required: true },
|
|
329
|
+
{ name: "projectKey", in: "query", required: true },
|
|
330
|
+
{ name: "issuetypeIds", in: "query", required: true },
|
|
331
|
+
],
|
|
332
|
+
},
|
|
333
|
+
ListProjects: {
|
|
334
|
+
path: "/{connectionId}/project",
|
|
335
|
+
method: "GET",
|
|
336
|
+
parameters: [
|
|
337
|
+
{ name: "connectionId", in: "path", required: true },
|
|
338
|
+
],
|
|
339
|
+
},
|
|
340
|
+
CreateProject: {
|
|
341
|
+
path: "/{connectionId}/project",
|
|
342
|
+
method: "POST",
|
|
343
|
+
parameters: [
|
|
344
|
+
{ name: "connectionId", in: "path", required: true },
|
|
345
|
+
{ name: "Project", in: "body", required: true },
|
|
346
|
+
],
|
|
347
|
+
},
|
|
348
|
+
CreateProject_V2: {
|
|
349
|
+
path: "/{connectionId}/v2/project",
|
|
350
|
+
method: "POST",
|
|
351
|
+
parameters: [
|
|
352
|
+
{ name: "connectionId", in: "path", required: true },
|
|
353
|
+
{ name: "X-Request-Jirainstance", in: "header", required: true },
|
|
354
|
+
{ name: "Project", in: "body", required: true },
|
|
355
|
+
],
|
|
356
|
+
},
|
|
357
|
+
ListProjects_V3: {
|
|
358
|
+
path: "/{connectionId}/v2/project/search",
|
|
359
|
+
method: "GET",
|
|
360
|
+
parameters: [
|
|
361
|
+
{ name: "connectionId", in: "path", required: true },
|
|
362
|
+
{ name: "X-Request-Jirainstance", in: "header", required: true },
|
|
363
|
+
],
|
|
364
|
+
},
|
|
365
|
+
ListStatuses: {
|
|
366
|
+
path: "/{connectionId}/project/{projectId}/statuses",
|
|
367
|
+
method: "GET",
|
|
368
|
+
parameters: [
|
|
369
|
+
{ name: "connectionId", in: "path", required: true },
|
|
370
|
+
{ name: "issueType", in: "query", required: true },
|
|
371
|
+
{ name: "projectId", in: "path", required: true },
|
|
372
|
+
],
|
|
373
|
+
},
|
|
374
|
+
ListStatuses_V2: {
|
|
375
|
+
path: "/{connectionId}/v2/project/{projectId}/statuses",
|
|
376
|
+
method: "GET",
|
|
377
|
+
parameters: [
|
|
378
|
+
{ name: "connectionId", in: "path", required: true },
|
|
379
|
+
{ name: "X-Request-Jirainstance", in: "header", required: true },
|
|
380
|
+
{ name: "projectId", in: "path", required: true },
|
|
381
|
+
{ name: "issueType", in: "query", required: false },
|
|
382
|
+
],
|
|
383
|
+
},
|
|
384
|
+
ListProjectUsers: {
|
|
385
|
+
path: "/{connectionId}/user/permission/search",
|
|
386
|
+
method: "GET",
|
|
387
|
+
parameters: [
|
|
388
|
+
{ name: "connectionId", in: "path", required: true },
|
|
389
|
+
{ name: "projectKey", in: "query", required: true },
|
|
390
|
+
],
|
|
391
|
+
},
|
|
392
|
+
ListProjectUsers_V2: {
|
|
393
|
+
path: "/{connectionId}/v2/user/permission/search",
|
|
394
|
+
method: "GET",
|
|
395
|
+
parameters: [
|
|
396
|
+
{ name: "connectionId", in: "path", required: true },
|
|
397
|
+
{ name: "X-Request-Jirainstance", in: "header", required: true },
|
|
398
|
+
{ name: "projectKey", in: "query", required: true },
|
|
399
|
+
],
|
|
400
|
+
},
|
|
401
|
+
ListAssignableUsers: {
|
|
402
|
+
path: "/{connectionId}/user/assignable/search",
|
|
403
|
+
method: "GET",
|
|
404
|
+
parameters: [
|
|
405
|
+
{ name: "connectionId", in: "path", required: true },
|
|
406
|
+
{ name: "projectKey", in: "query", required: true },
|
|
407
|
+
],
|
|
408
|
+
},
|
|
409
|
+
ListAssignableUsers_V2: {
|
|
410
|
+
path: "/{connectionId}/v2/user/assignable/search",
|
|
411
|
+
method: "GET",
|
|
412
|
+
parameters: [
|
|
413
|
+
{ name: "connectionId", in: "path", required: true },
|
|
414
|
+
{ name: "X-Request-Jirainstance", in: "header", required: true },
|
|
415
|
+
{ name: "projectKey", in: "query", required: true },
|
|
416
|
+
],
|
|
417
|
+
},
|
|
418
|
+
ListPriorityTypes: {
|
|
419
|
+
path: "/{connectionId}/priority",
|
|
420
|
+
method: "GET",
|
|
421
|
+
parameters: [
|
|
422
|
+
{ name: "connectionId", in: "path", required: true },
|
|
423
|
+
],
|
|
424
|
+
},
|
|
425
|
+
ListPriorityTypes_V2: {
|
|
426
|
+
path: "/{connectionId}/v2/priority",
|
|
427
|
+
method: "GET",
|
|
428
|
+
parameters: [
|
|
429
|
+
{ name: "connectionId", in: "path", required: true },
|
|
430
|
+
{ name: "X-Request-Jirainstance", in: "header", required: true },
|
|
431
|
+
],
|
|
432
|
+
},
|
|
433
|
+
ListFilters: {
|
|
434
|
+
path: "/{connectionId}/2/filter/search",
|
|
435
|
+
method: "GET",
|
|
436
|
+
parameters: [
|
|
437
|
+
{ name: "connectionId", in: "path", required: true },
|
|
438
|
+
],
|
|
439
|
+
},
|
|
440
|
+
ListResources: {
|
|
441
|
+
path: "/{connectionId}/oauth/token/accessible-resources",
|
|
442
|
+
method: "GET",
|
|
443
|
+
parameters: [
|
|
444
|
+
{ name: "connectionId", in: "path", required: true },
|
|
445
|
+
],
|
|
446
|
+
},
|
|
447
|
+
ListIssues_Datacenter: {
|
|
448
|
+
path: "/{connectionId}/datacenter/search",
|
|
449
|
+
method: "GET",
|
|
450
|
+
parameters: [
|
|
451
|
+
{ name: "connectionId", in: "path", required: true },
|
|
452
|
+
{ name: "X-Request-Jirainstance", in: "header", required: true },
|
|
453
|
+
],
|
|
454
|
+
},
|
|
455
|
+
ListTransitions: {
|
|
456
|
+
path: "/{connectionId}/3/issue/{issueIdOrKey}/transitions",
|
|
457
|
+
method: "GET",
|
|
458
|
+
parameters: [
|
|
459
|
+
{ name: "connectionId", in: "path", required: true },
|
|
460
|
+
{ name: "X-Request-Jirainstance", in: "header", required: true },
|
|
461
|
+
{ name: "issueIdOrKey", in: "path", required: true },
|
|
462
|
+
],
|
|
463
|
+
},
|
|
464
|
+
UpdateTransition: {
|
|
465
|
+
path: "/{connectionId}/3/issue/{issueIdOrKey}/transitions",
|
|
466
|
+
method: "POST",
|
|
467
|
+
parameters: [
|
|
468
|
+
{ name: "connectionId", in: "path", required: true },
|
|
469
|
+
{ name: "X-Request-Jirainstance", in: "header", required: true },
|
|
470
|
+
{ name: "issueIdOrKey", in: "path", required: true },
|
|
471
|
+
{ name: "body", in: "body", required: true },
|
|
472
|
+
],
|
|
473
|
+
},
|
|
474
|
+
OnNewIssue: {
|
|
475
|
+
path: "/{connectionId}/new_issue_trigger/search",
|
|
476
|
+
method: "GET",
|
|
477
|
+
parameters: [
|
|
478
|
+
{ name: "connectionId", in: "path", required: true },
|
|
479
|
+
{ name: "projectKey", in: "query", required: true },
|
|
480
|
+
],
|
|
481
|
+
},
|
|
482
|
+
OnNewIssue_V2: {
|
|
483
|
+
path: "/{connectionId}/v2/new_issue_trigger/search",
|
|
484
|
+
method: "GET",
|
|
485
|
+
parameters: [
|
|
486
|
+
{ name: "connectionId", in: "path", required: true },
|
|
487
|
+
{ name: "projectKey", in: "query", required: true },
|
|
488
|
+
{ name: "X-Request-Jirainstance", in: "query", required: false },
|
|
489
|
+
],
|
|
490
|
+
},
|
|
491
|
+
OnNewIssue_Datacenter: {
|
|
492
|
+
path: "/{connectionId}/datacenter/new_issue_trigger/search",
|
|
493
|
+
method: "GET",
|
|
494
|
+
parameters: [
|
|
495
|
+
{ name: "connectionId", in: "path", required: true },
|
|
496
|
+
{ name: "projectKey", in: "query", required: true },
|
|
497
|
+
{ name: "X-Request-Jirainstance", in: "query", required: false },
|
|
498
|
+
],
|
|
499
|
+
},
|
|
500
|
+
OnCloseIssue: {
|
|
501
|
+
path: "/{connectionId}/close_issue_trigger/search",
|
|
502
|
+
method: "GET",
|
|
503
|
+
parameters: [
|
|
504
|
+
{ name: "connectionId", in: "path", required: true },
|
|
505
|
+
{ name: "projectKey", in: "query", required: true },
|
|
506
|
+
],
|
|
507
|
+
},
|
|
508
|
+
OnCloseIssue_V2: {
|
|
509
|
+
path: "/{connectionId}/v2/close_issue_trigger/search",
|
|
510
|
+
method: "GET",
|
|
511
|
+
parameters: [
|
|
512
|
+
{ name: "connectionId", in: "path", required: true },
|
|
513
|
+
{ name: "projectKey", in: "query", required: true },
|
|
514
|
+
{ name: "X-Request-Jirainstance", in: "query", required: false },
|
|
515
|
+
],
|
|
516
|
+
},
|
|
517
|
+
OnCloseIssue_Datacenter: {
|
|
518
|
+
path: "/{connectionId}/datacenter/close_issue_trigger/search",
|
|
519
|
+
method: "GET",
|
|
520
|
+
parameters: [
|
|
521
|
+
{ name: "connectionId", in: "path", required: true },
|
|
522
|
+
{ name: "projectKey", in: "query", required: true },
|
|
523
|
+
{ name: "X-Request-Jirainstance", in: "query", required: false },
|
|
524
|
+
],
|
|
525
|
+
},
|
|
526
|
+
OnUpdateIssue: {
|
|
527
|
+
path: "/{connectionId}/update_issue_trigger/search",
|
|
528
|
+
method: "GET",
|
|
529
|
+
parameters: [
|
|
530
|
+
{ name: "connectionId", in: "path", required: true },
|
|
531
|
+
{ name: "projectKey", in: "query", required: true },
|
|
532
|
+
],
|
|
533
|
+
},
|
|
534
|
+
OnUpdateIssue_V2: {
|
|
535
|
+
path: "/{connectionId}/v2/update_issue_trigger/search",
|
|
536
|
+
method: "GET",
|
|
537
|
+
parameters: [
|
|
538
|
+
{ name: "connectionId", in: "path", required: true },
|
|
539
|
+
{ name: "projectKey", in: "query", required: true },
|
|
540
|
+
{ name: "X-Request-Jirainstance", in: "query", required: false },
|
|
541
|
+
],
|
|
542
|
+
},
|
|
543
|
+
OnUpdateIssue_Datacenter: {
|
|
544
|
+
path: "/{connectionId}/datacenter/update_issue_trigger/search",
|
|
545
|
+
method: "GET",
|
|
546
|
+
parameters: [
|
|
547
|
+
{ name: "connectionId", in: "path", required: true },
|
|
548
|
+
{ name: "projectKey", in: "query", required: true },
|
|
549
|
+
{ name: "X-Request-Jirainstance", in: "query", required: false },
|
|
550
|
+
],
|
|
551
|
+
},
|
|
552
|
+
OnNewIssueJQL: {
|
|
553
|
+
path: "/{connectionId}/new_issue_jql_trigger/search",
|
|
554
|
+
method: "GET",
|
|
555
|
+
parameters: [
|
|
556
|
+
{ name: "connectionId", in: "path", required: true },
|
|
557
|
+
{ name: "jql", in: "query", required: true },
|
|
558
|
+
],
|
|
559
|
+
},
|
|
560
|
+
OnNewIssueJQL_V2: {
|
|
561
|
+
path: "/{connectionId}/v2/new_issue_jql_trigger/search",
|
|
562
|
+
method: "GET",
|
|
563
|
+
parameters: [
|
|
564
|
+
{ name: "connectionId", in: "path", required: true },
|
|
565
|
+
{ name: "jql", in: "query", required: true },
|
|
566
|
+
{ name: "X-Request-Jirainstance", in: "query", required: false },
|
|
567
|
+
],
|
|
568
|
+
},
|
|
569
|
+
OnNewIssueJQL_Datacenter: {
|
|
570
|
+
path: "/{connectionId}/datacenter/new_issue_jql_trigger/search",
|
|
571
|
+
method: "GET",
|
|
572
|
+
parameters: [
|
|
573
|
+
{ name: "connectionId", in: "path", required: true },
|
|
574
|
+
{ name: "jql", in: "query", required: true },
|
|
575
|
+
{ name: "X-Request-Jirainstance", in: "query", required: false },
|
|
576
|
+
],
|
|
577
|
+
},
|
|
578
|
+
mcp_JiraIssueManagement: {
|
|
579
|
+
path: "/{connectionId}/mcp/JiraIssueManagement",
|
|
580
|
+
method: "POST",
|
|
581
|
+
parameters: [
|
|
582
|
+
{ name: "connectionId", in: "path", required: true },
|
|
583
|
+
{ name: "queryRequest", in: "body", required: false },
|
|
584
|
+
{ name: "sessionId", in: "query", required: false },
|
|
585
|
+
],
|
|
586
|
+
},
|
|
587
|
+
});
|
|
588
|
+
|
|
589
|
+
function isJiraObject(oValue) {
|
|
590
|
+
return !!oValue && typeof oValue === "object" && !Array.isArray(oValue);
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
function pickJiraValue() {
|
|
594
|
+
for (let iIndex = 0; iIndex < arguments.length; iIndex += 1) {
|
|
595
|
+
const oValue = arguments[iIndex];
|
|
596
|
+
if (oValue !== undefined && oValue !== null) {
|
|
597
|
+
return oValue;
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
return undefined;
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
function setJiraIfDefined(oTarget, sKey, oValue) {
|
|
605
|
+
if (oValue !== undefined && oValue !== null) {
|
|
606
|
+
oTarget[sKey] = oValue;
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
return oTarget;
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
function normalizeJiraList(oValue) {
|
|
613
|
+
if (Array.isArray(oValue)) {
|
|
614
|
+
return oValue.join(",");
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
return oValue;
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
function normalizeJiraInstance(oOptions, sFallback) {
|
|
621
|
+
if (typeof oOptions === "string") {
|
|
622
|
+
return oOptions;
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
if (!isJiraObject(oOptions)) {
|
|
626
|
+
return sFallback;
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
return pickJiraValue(
|
|
630
|
+
oOptions.jiraInstance,
|
|
631
|
+
oOptions.instance,
|
|
632
|
+
oOptions.jiraUrl,
|
|
633
|
+
oOptions.site,
|
|
634
|
+
oOptions["X-Request-Jirainstance"],
|
|
635
|
+
sFallback
|
|
636
|
+
);
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
function withJiraInstance(oParams, sJiraInstance) {
|
|
640
|
+
if (sJiraInstance) {
|
|
641
|
+
oParams["X-Request-Jirainstance"] = sJiraInstance;
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
return oParams;
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
function normalizeJiraCommentBody(oBody) {
|
|
648
|
+
if (typeof oBody === "string") {
|
|
649
|
+
return { body: oBody };
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
if (!isJiraObject(oBody)) {
|
|
653
|
+
return oBody;
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
if (oBody.body !== undefined) {
|
|
657
|
+
return oBody;
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
if (typeof oBody.comment === "string") {
|
|
661
|
+
return { body: oBody.comment };
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
if (typeof oBody.text === "string") {
|
|
665
|
+
return { body: oBody.text };
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
return oBody;
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
function normalizeJiraEditBody(oOptions) {
|
|
672
|
+
if (!isJiraObject(oOptions)) {
|
|
673
|
+
return oOptions;
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
if (isJiraObject(oOptions.body)) {
|
|
677
|
+
return oOptions.body;
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
const oBody = {};
|
|
681
|
+
setJiraIfDefined(oBody, "transition", oOptions.transition);
|
|
682
|
+
setJiraIfDefined(oBody, "fields", oOptions.fields);
|
|
683
|
+
setJiraIfDefined(oBody, "update", oOptions.update);
|
|
684
|
+
setJiraIfDefined(oBody, "historyMetadata", oOptions.historyMetadata);
|
|
685
|
+
setJiraIfDefined(oBody, "properties", oOptions.properties);
|
|
686
|
+
return Object.keys(oBody).length > 0 ? oBody : undefined;
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
function normalizeJiraIssuePayload(oOptions) {
|
|
690
|
+
if (!isJiraObject(oOptions)) {
|
|
691
|
+
return oOptions;
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
if (isJiraObject(oOptions.body)) {
|
|
695
|
+
return oOptions.body;
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
if (isJiraObject(oOptions.item)) {
|
|
699
|
+
return oOptions.item;
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
if (isJiraObject(oOptions.issue)) {
|
|
703
|
+
return oOptions.issue;
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
if (isJiraObject(oOptions.fields)) {
|
|
707
|
+
return { fields: oOptions.fields };
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
return undefined;
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
function normalizeJiraProjectBody(oOptions) {
|
|
714
|
+
if (!isJiraObject(oOptions)) {
|
|
715
|
+
return oOptions;
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
if (isJiraObject(oOptions.body)) {
|
|
719
|
+
return oOptions.body;
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
if (isJiraObject(oOptions.Project)) {
|
|
723
|
+
return oOptions.Project;
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
const oBody = {};
|
|
727
|
+
[
|
|
728
|
+
"key",
|
|
729
|
+
"name",
|
|
730
|
+
"projectTypeKey",
|
|
731
|
+
"projectTemplateKey",
|
|
732
|
+
"description",
|
|
733
|
+
"lead",
|
|
734
|
+
"leadAccountId",
|
|
735
|
+
"url",
|
|
736
|
+
"assigneeType",
|
|
737
|
+
"avatarId",
|
|
738
|
+
"issueSecurityScheme",
|
|
739
|
+
"permissionScheme",
|
|
740
|
+
"notificationScheme",
|
|
741
|
+
"categoryId",
|
|
742
|
+
].forEach(function(sKey) {
|
|
743
|
+
setJiraIfDefined(oBody, sKey, oOptions[sKey]);
|
|
744
|
+
});
|
|
745
|
+
|
|
746
|
+
return Object.keys(oBody).length > 0 ? oBody : undefined;
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
function normalizeJiraProjectCategoryBody(oOptions) {
|
|
750
|
+
if (!isJiraObject(oOptions)) {
|
|
751
|
+
return oOptions;
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
if (isJiraObject(oOptions.body)) {
|
|
755
|
+
return oOptions.body;
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
const oBody = {};
|
|
759
|
+
setJiraIfDefined(oBody, "name", oOptions.name);
|
|
760
|
+
setJiraIfDefined(oBody, "description", oOptions.description);
|
|
761
|
+
return Object.keys(oBody).length > 0 ? oBody : undefined;
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
function normalizeJiraTransitionBody(oOptions) {
|
|
765
|
+
if (!isJiraObject(oOptions)) {
|
|
766
|
+
return oOptions;
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
if (isJiraObject(oOptions.body)) {
|
|
770
|
+
return oOptions.body;
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
const oBody = {};
|
|
774
|
+
setJiraIfDefined(oBody, "fields", oOptions.fields);
|
|
775
|
+
setJiraIfDefined(oBody, "historyMetadata", oOptions.historyMetadata);
|
|
776
|
+
setJiraIfDefined(oBody, "transition", oOptions.transition);
|
|
777
|
+
setJiraIfDefined(oBody, "update", oOptions.update);
|
|
778
|
+
return Object.keys(oBody).length > 0 ? oBody : undefined;
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
async function execJiraOp(operationName, parameters) {
|
|
782
|
+
return execConnectorOpWithCandidates(JIRA_DATA_SOURCE_CANDIDATES, JIRA_APIS, "Jira", operationName, parameters);
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
export async function callJiraOperation(operationName, parameters = {}) {
|
|
786
|
+
return _dbgWrap('callJiraOperation', [operationName, parameters], async function() {
|
|
787
|
+
return execJiraOp(operationName, parameters);
|
|
788
|
+
});
|
|
789
|
+
}
|
|
790
|
+
|
|
791
|
+
export async function addJiraComment(sIssueKey, body, sJiraInstance) {
|
|
792
|
+
return _dbgWrap('addJiraComment', [sIssueKey, body, sJiraInstance], async function() {
|
|
793
|
+
if (isJiraObject(sIssueKey)) {
|
|
794
|
+
sJiraInstance = normalizeJiraInstance(sIssueKey, sJiraInstance);
|
|
795
|
+
body = pickJiraValue(sIssueKey.body, sIssueKey.comment, sIssueKey.text);
|
|
796
|
+
sIssueKey = pickJiraValue(sIssueKey.issueKey, sIssueKey.issueIdOrKey, sIssueKey.id, sIssueKey.key);
|
|
797
|
+
} else if (isJiraObject(body) && !Object.prototype.hasOwnProperty.call(body, "body") && sJiraInstance === undefined) {
|
|
798
|
+
sJiraInstance = normalizeJiraInstance(body, sJiraInstance);
|
|
799
|
+
body = pickJiraValue(body.body, body.comment, body.text, body);
|
|
800
|
+
}
|
|
801
|
+
|
|
802
|
+
const sOperationName = sJiraInstance ? "AddComment_V2" : "AddComment";
|
|
803
|
+
return execJiraOp(sOperationName, withJiraInstance({
|
|
804
|
+
issueKey: sIssueKey,
|
|
805
|
+
body: normalizeJiraCommentBody(body),
|
|
806
|
+
}, sJiraInstance));
|
|
807
|
+
});
|
|
808
|
+
}
|
|
809
|
+
|
|
810
|
+
export async function cancelJiraTask(sTaskId, sJiraInstance, sToken) {
|
|
811
|
+
return _dbgWrap('cancelJiraTask', [sTaskId, sJiraInstance, sToken], async function() {
|
|
812
|
+
if (isJiraObject(sTaskId)) {
|
|
813
|
+
sToken = pickJiraValue(sTaskId.token, sTaskId.atlassianToken, sTaskId["X-Atlassian-Token"], sToken);
|
|
814
|
+
sJiraInstance = normalizeJiraInstance(sTaskId, sJiraInstance);
|
|
815
|
+
sTaskId = pickJiraValue(sTaskId.taskId, sTaskId.id);
|
|
816
|
+
} else if (isJiraObject(sJiraInstance)) {
|
|
817
|
+
sToken = pickJiraValue(sJiraInstance.token, sJiraInstance.atlassianToken, sJiraInstance["X-Atlassian-Token"], sToken);
|
|
818
|
+
sJiraInstance = normalizeJiraInstance(sJiraInstance);
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
const sOperationName = sJiraInstance ? "CancelTask_V2" : "CancelTask";
|
|
822
|
+
return execJiraOp(sOperationName, withJiraInstance({
|
|
823
|
+
taskId: sTaskId,
|
|
824
|
+
"X-Atlassian-Token": sToken || "nocheck",
|
|
825
|
+
}, sJiraInstance));
|
|
826
|
+
});
|
|
827
|
+
}
|
|
828
|
+
|
|
829
|
+
export async function createJiraIssueV3(oOptions = {}) {
|
|
830
|
+
return _dbgWrap('createJiraIssueV3', [oOptions], async function() {
|
|
831
|
+
const jiraInstance = normalizeJiraInstance(oOptions);
|
|
832
|
+
const projectKey = pickJiraValue(oOptions.projectKey, oOptions.project, oOptions.key);
|
|
833
|
+
const issueTypeIds = pickJiraValue(oOptions.issueTypeIds, oOptions.issueTypeId, oOptions.issuetypeIds);
|
|
834
|
+
const item = normalizeJiraIssuePayload(oOptions);
|
|
835
|
+
return execJiraOp("CreateIssue_V3", {
|
|
836
|
+
"X-Request-Jirainstance": jiraInstance,
|
|
837
|
+
projectKey,
|
|
838
|
+
issueTypeIds: normalizeJiraList(issueTypeIds),
|
|
839
|
+
item,
|
|
840
|
+
});
|
|
841
|
+
});
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
export async function editJiraIssueV2(sIssueIdOrKey, oOptions = {}) {
|
|
845
|
+
return _dbgWrap('editJiraIssueV2', [sIssueIdOrKey, oOptions], async function() {
|
|
846
|
+
let jiraInstance = normalizeJiraInstance(oOptions);
|
|
847
|
+
let notifyUsers = oOptions.notifyUsers;
|
|
848
|
+
let overrideScreenSecurity = oOptions.overrideScreenSecurity;
|
|
849
|
+
let overrideEditableFlag = oOptions.overrideEditableFlag;
|
|
850
|
+
let body = normalizeJiraEditBody(oOptions);
|
|
851
|
+
|
|
852
|
+
if (isJiraObject(sIssueIdOrKey)) {
|
|
853
|
+
jiraInstance = normalizeJiraInstance(sIssueIdOrKey, jiraInstance);
|
|
854
|
+
notifyUsers = pickJiraValue(sIssueIdOrKey.notifyUsers, notifyUsers);
|
|
855
|
+
overrideScreenSecurity = pickJiraValue(sIssueIdOrKey.overrideScreenSecurity, overrideScreenSecurity);
|
|
856
|
+
overrideEditableFlag = pickJiraValue(sIssueIdOrKey.overrideEditableFlag, overrideEditableFlag);
|
|
857
|
+
body = normalizeJiraEditBody(sIssueIdOrKey);
|
|
858
|
+
sIssueIdOrKey = pickJiraValue(sIssueIdOrKey.issueIdOrKey, sIssueIdOrKey.issueKey, sIssueIdOrKey.id, sIssueIdOrKey.key);
|
|
859
|
+
}
|
|
860
|
+
|
|
861
|
+
return execJiraOp("EditIssue_V2", {
|
|
862
|
+
"X-Request-Jirainstance": jiraInstance,
|
|
863
|
+
issueIdOrKey: sIssueIdOrKey,
|
|
864
|
+
notifyUsers,
|
|
865
|
+
overrideScreenSecurity,
|
|
866
|
+
overrideEditableFlag,
|
|
867
|
+
body: normalizeJiraEditBody({ body }),
|
|
868
|
+
});
|
|
869
|
+
});
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
export async function getCurrentJiraUser({ jiraInstance, expand } = {}) {
|
|
873
|
+
return _dbgWrap('getCurrentJiraUser', [{ jiraInstance, expand }], async function() {
|
|
874
|
+
jiraInstance = normalizeJiraInstance({ jiraInstance });
|
|
875
|
+
return execJiraOp("GetCurrentUser", {
|
|
876
|
+
"X-Request-Jirainstance": jiraInstance,
|
|
877
|
+
expand: normalizeJiraList(expand),
|
|
878
|
+
});
|
|
879
|
+
});
|
|
880
|
+
}
|
|
881
|
+
|
|
882
|
+
export async function getJiraIssueByKey(sIssueKey, sJiraInstance) {
|
|
883
|
+
return _dbgWrap('getJiraIssueByKey', [sIssueKey, sJiraInstance], async function() {
|
|
884
|
+
if (isJiraObject(sIssueKey)) {
|
|
885
|
+
sJiraInstance = normalizeJiraInstance(sIssueKey, sJiraInstance);
|
|
886
|
+
sIssueKey = pickJiraValue(sIssueKey.issueKey, sIssueKey.issueIdOrKey, sIssueKey.id, sIssueKey.key);
|
|
887
|
+
} else if (isJiraObject(sJiraInstance)) {
|
|
888
|
+
sJiraInstance = normalizeJiraInstance(sJiraInstance, sJiraInstance);
|
|
889
|
+
}
|
|
890
|
+
|
|
891
|
+
const sOperationName = sJiraInstance ? "GetIssue_V2" : "GetIssue";
|
|
892
|
+
return execJiraOp(sOperationName, withJiraInstance({
|
|
893
|
+
issueKey: sIssueKey,
|
|
894
|
+
}, sJiraInstance));
|
|
895
|
+
});
|
|
896
|
+
}
|
|
897
|
+
|
|
898
|
+
export async function listJiraFilters(sJiraInstance) {
|
|
899
|
+
return _dbgWrap('listJiraFilters', [sJiraInstance], async function() {
|
|
900
|
+
const sInstance = normalizeJiraInstance(sJiraInstance);
|
|
901
|
+
const sOperationName = sInstance ? "ListFilters_V2" : "ListFilters";
|
|
902
|
+
return execJiraOp(sOperationName, withJiraInstance({}, sInstance));
|
|
903
|
+
});
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
export async function listJiraIssues({ jiraInstance, jql, fields, expand } = {}) {
|
|
907
|
+
return _dbgWrap('listJiraIssues', [{ jiraInstance, jql, fields, expand }], async function() {
|
|
908
|
+
return execJiraOp("ListIssues", {
|
|
909
|
+
"X-Request-Jirainstance": jiraInstance,
|
|
910
|
+
jql,
|
|
911
|
+
fields: normalizeJiraList(fields),
|
|
912
|
+
expand: normalizeJiraList(expand),
|
|
913
|
+
});
|
|
914
|
+
});
|
|
915
|
+
}
|
|
916
|
+
|
|
917
|
+
export async function listJiraProjects(oOptions) {
|
|
918
|
+
return _dbgWrap('listJiraProjects', [oOptions], async function() {
|
|
919
|
+
const sJiraInstance = normalizeJiraInstance(oOptions);
|
|
920
|
+
return execJiraOp(sJiraInstance ? "ListProjects_V3" : "ListProjects_V2", withJiraInstance({}, sJiraInstance));
|
|
921
|
+
});
|
|
922
|
+
}
|
|
923
|
+
|
|
924
|
+
export async function getJiraTask(sTaskId, sJiraInstance) {
|
|
925
|
+
return _dbgWrap('getJiraTask', [sTaskId, sJiraInstance], async function() {
|
|
926
|
+
if (isJiraObject(sTaskId)) {
|
|
927
|
+
sJiraInstance = normalizeJiraInstance(sTaskId, sJiraInstance);
|
|
928
|
+
sTaskId = pickJiraValue(sTaskId.taskId, sTaskId.id);
|
|
929
|
+
}
|
|
930
|
+
|
|
931
|
+
const sOperationName = sJiraInstance ? "GetTask_V2" : "GetTask";
|
|
932
|
+
return execJiraOp(sOperationName, withJiraInstance({
|
|
933
|
+
taskId: sTaskId,
|
|
934
|
+
}, sJiraInstance));
|
|
935
|
+
});
|
|
936
|
+
}
|
|
937
|
+
|
|
938
|
+
export async function getJiraUser(sAccountId, oOptions = {}) {
|
|
939
|
+
return _dbgWrap('getJiraUser', [sAccountId, oOptions], async function() {
|
|
940
|
+
let jiraInstance = normalizeJiraInstance(oOptions);
|
|
941
|
+
let expand = isJiraObject(oOptions) ? oOptions.expand : undefined;
|
|
942
|
+
|
|
943
|
+
if (isJiraObject(sAccountId)) {
|
|
944
|
+
jiraInstance = normalizeJiraInstance(sAccountId, jiraInstance);
|
|
945
|
+
expand = pickJiraValue(sAccountId.expand, expand);
|
|
946
|
+
sAccountId = pickJiraValue(sAccountId.accountId, sAccountId.userId, sAccountId.id);
|
|
947
|
+
} else if (typeof oOptions === "string") {
|
|
948
|
+
jiraInstance = oOptions;
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
const sOperationName = jiraInstance ? "GetUser_V2" : "GetUser";
|
|
952
|
+
return execJiraOp(sOperationName, withJiraInstance({
|
|
953
|
+
accountId: sAccountId,
|
|
954
|
+
expand: normalizeJiraList(expand),
|
|
955
|
+
}, jiraInstance));
|
|
956
|
+
});
|
|
957
|
+
}
|
|
958
|
+
|
|
959
|
+
export async function editJiraIssue(sIssueIdOrKey, oOptions = {}) {
|
|
960
|
+
return _dbgWrap('editJiraIssue', [sIssueIdOrKey, oOptions], async function() {
|
|
961
|
+
if (isJiraObject(sIssueIdOrKey)) {
|
|
962
|
+
oOptions = sIssueIdOrKey;
|
|
963
|
+
sIssueIdOrKey = pickJiraValue(oOptions.issueIdOrKey, oOptions.issueKey, oOptions.id, oOptions.key);
|
|
964
|
+
}
|
|
965
|
+
|
|
966
|
+
const sJiraInstance = normalizeJiraInstance(oOptions);
|
|
967
|
+
const sOperationName = sJiraInstance ? "EditIssue_V2" : "EditIssue";
|
|
968
|
+
return execJiraOp(sOperationName, withJiraInstance({
|
|
969
|
+
issueIdOrKey: sIssueIdOrKey,
|
|
970
|
+
notifyUsers: oOptions.notifyUsers,
|
|
971
|
+
overrideScreenSecurity: oOptions.overrideScreenSecurity,
|
|
972
|
+
overrideEditableFlag: oOptions.overrideEditableFlag,
|
|
973
|
+
body: normalizeJiraEditBody(oOptions),
|
|
974
|
+
}, sJiraInstance));
|
|
975
|
+
});
|
|
976
|
+
}
|
|
977
|
+
|
|
978
|
+
export async function createJiraIssue(oOptions = {}) {
|
|
979
|
+
return _dbgWrap('createJiraIssue', [oOptions], async function() {
|
|
980
|
+
const sJiraInstance = normalizeJiraInstance(oOptions);
|
|
981
|
+
const sProjectKey = pickJiraValue(oOptions.projectKey, oOptions.project, oOptions.key);
|
|
982
|
+
const sIssueTypeIds = normalizeJiraList(pickJiraValue(oOptions.issueTypeIds, oOptions.issueTypeId, oOptions.issuetypeIds));
|
|
983
|
+
const oPayload = normalizeJiraIssuePayload(oOptions);
|
|
984
|
+
|
|
985
|
+
if (sJiraInstance) {
|
|
986
|
+
return execJiraOp("CreateIssue_V3", withJiraInstance({
|
|
987
|
+
projectKey: sProjectKey,
|
|
988
|
+
issueTypeIds: sIssueTypeIds,
|
|
989
|
+
item: oPayload,
|
|
990
|
+
}, sJiraInstance));
|
|
991
|
+
}
|
|
992
|
+
|
|
993
|
+
if (sIssueTypeIds !== undefined) {
|
|
994
|
+
return execJiraOp("CreateIssueV2", {
|
|
995
|
+
projectKey: sProjectKey,
|
|
996
|
+
issueTypeIds: sIssueTypeIds,
|
|
997
|
+
item: oPayload,
|
|
998
|
+
});
|
|
999
|
+
}
|
|
1000
|
+
|
|
1001
|
+
return execJiraOp("CreateIssue", {
|
|
1002
|
+
projectKey: sProjectKey,
|
|
1003
|
+
body: oPayload,
|
|
1004
|
+
});
|
|
1005
|
+
});
|
|
1006
|
+
}
|
|
1007
|
+
|
|
1008
|
+
export async function updateJiraIssue(sIssueKey, oOptions = {}) {
|
|
1009
|
+
return _dbgWrap('updateJiraIssue', [sIssueKey, oOptions], async function() {
|
|
1010
|
+
if (isJiraObject(sIssueKey)) {
|
|
1011
|
+
oOptions = sIssueKey;
|
|
1012
|
+
sIssueKey = pickJiraValue(oOptions.issueKey, oOptions.issueIdOrKey, oOptions.id, oOptions.key);
|
|
1013
|
+
}
|
|
1014
|
+
|
|
1015
|
+
const sJiraInstance = normalizeJiraInstance(oOptions);
|
|
1016
|
+
const sOperationName = sJiraInstance ? "UpdateIssue_V2" : "UpdateIssue";
|
|
1017
|
+
return execJiraOp(sOperationName, withJiraInstance({
|
|
1018
|
+
issueKey: sIssueKey,
|
|
1019
|
+
body: normalizeJiraIssuePayload(oOptions),
|
|
1020
|
+
}, sJiraInstance));
|
|
1021
|
+
});
|
|
1022
|
+
}
|
|
1023
|
+
|
|
1024
|
+
export async function listJiraIssueTypes(oOptions = {}) {
|
|
1025
|
+
return _dbgWrap('listJiraIssueTypes', [oOptions], async function() {
|
|
1026
|
+
const sJiraInstance = normalizeJiraInstance(oOptions);
|
|
1027
|
+
const sOperationName = sJiraInstance ? "ListIssueTypes_V2" : "ListIssueTypes";
|
|
1028
|
+
return execJiraOp(sOperationName, withJiraInstance({
|
|
1029
|
+
projectKey: pickJiraValue(oOptions.projectKey, oOptions.project, oOptions.key),
|
|
1030
|
+
}, sJiraInstance));
|
|
1031
|
+
});
|
|
1032
|
+
}
|
|
1033
|
+
|
|
1034
|
+
export async function listJiraIssueTypeFields(oOptions = {}) {
|
|
1035
|
+
return _dbgWrap('listJiraIssueTypeFields', [oOptions], async function() {
|
|
1036
|
+
const sJiraInstance = normalizeJiraInstance(oOptions);
|
|
1037
|
+
const sOperationName = sJiraInstance ? "ListIssueTypesFields_V2" : "ListIssueTypesFields";
|
|
1038
|
+
return execJiraOp(sOperationName, withJiraInstance({
|
|
1039
|
+
projectKey: pickJiraValue(oOptions.projectKey, oOptions.project, oOptions.key),
|
|
1040
|
+
issuetypeIds: normalizeJiraList(pickJiraValue(oOptions.issueTypeIds, oOptions.issueTypeId, oOptions.issuetypeIds)),
|
|
1041
|
+
}, sJiraInstance));
|
|
1042
|
+
});
|
|
1043
|
+
}
|
|
1044
|
+
|
|
1045
|
+
export async function createJiraProject(oOptions = {}) {
|
|
1046
|
+
return _dbgWrap('createJiraProject', [oOptions], async function() {
|
|
1047
|
+
const sJiraInstance = normalizeJiraInstance(oOptions);
|
|
1048
|
+
const sOperationName = sJiraInstance ? "CreateProject_V2" : "CreateProject";
|
|
1049
|
+
const oParams = {};
|
|
1050
|
+
setJiraIfDefined(oParams, "Project", normalizeJiraProjectBody(oOptions));
|
|
1051
|
+
return execJiraOp(sOperationName, withJiraInstance(oParams, sJiraInstance));
|
|
1052
|
+
});
|
|
1053
|
+
}
|
|
1054
|
+
|
|
1055
|
+
export async function updateJiraProject(sProjectIdOrKey, oOptions = {}) {
|
|
1056
|
+
return _dbgWrap('updateJiraProject', [sProjectIdOrKey, oOptions], async function() {
|
|
1057
|
+
if (isJiraObject(sProjectIdOrKey)) {
|
|
1058
|
+
oOptions = sProjectIdOrKey;
|
|
1059
|
+
sProjectIdOrKey = pickJiraValue(oOptions.projectIdOrKey, oOptions.projectKey, oOptions.projectId, oOptions.id, oOptions.key);
|
|
1060
|
+
}
|
|
1061
|
+
|
|
1062
|
+
const sJiraInstance = normalizeJiraInstance(oOptions);
|
|
1063
|
+
const sOperationName = sJiraInstance ? "UpdateProject_V2" : "UpdateProject";
|
|
1064
|
+
return execJiraOp(sOperationName, withJiraInstance({
|
|
1065
|
+
projectIdOrKey: sProjectIdOrKey,
|
|
1066
|
+
body: normalizeJiraProjectBody(oOptions),
|
|
1067
|
+
}, sJiraInstance));
|
|
1068
|
+
});
|
|
1069
|
+
}
|
|
1070
|
+
|
|
1071
|
+
export async function deleteJiraProject(sProjectIdOrKey, oOptions = {}) {
|
|
1072
|
+
return _dbgWrap('deleteJiraProject', [sProjectIdOrKey, oOptions], async function() {
|
|
1073
|
+
if (isJiraObject(sProjectIdOrKey)) {
|
|
1074
|
+
oOptions = sProjectIdOrKey;
|
|
1075
|
+
sProjectIdOrKey = pickJiraValue(oOptions.projectIdOrKey, oOptions.projectKey, oOptions.projectId, oOptions.id, oOptions.key);
|
|
1076
|
+
}
|
|
1077
|
+
|
|
1078
|
+
const sJiraInstance = normalizeJiraInstance(oOptions);
|
|
1079
|
+
const sOperationName = sJiraInstance ? "DeleteProject_V2" : "DeleteProject";
|
|
1080
|
+
return execJiraOp(sOperationName, withJiraInstance({
|
|
1081
|
+
projectIdOrKey: sProjectIdOrKey,
|
|
1082
|
+
enableUndo: oOptions.enableUndo,
|
|
1083
|
+
}, sJiraInstance));
|
|
1084
|
+
});
|
|
1085
|
+
}
|
|
1086
|
+
|
|
1087
|
+
export async function listJiraProjectCategories(oOptions) {
|
|
1088
|
+
return _dbgWrap('listJiraProjectCategories', [oOptions], async function() {
|
|
1089
|
+
const sJiraInstance = normalizeJiraInstance(oOptions);
|
|
1090
|
+
return execJiraOp(sJiraInstance ? "GetAllProjectCategories_V2" : "GetAllProjectCategories", withJiraInstance({}, sJiraInstance));
|
|
1091
|
+
});
|
|
1092
|
+
}
|
|
1093
|
+
|
|
1094
|
+
export async function createJiraProjectCategory(oOptions = {}) {
|
|
1095
|
+
return _dbgWrap('createJiraProjectCategory', [oOptions], async function() {
|
|
1096
|
+
const sJiraInstance = normalizeJiraInstance(oOptions);
|
|
1097
|
+
return execJiraOp(sJiraInstance ? "CreateProjectCategory_V2" : "CreateProjectCategory", withJiraInstance({
|
|
1098
|
+
body: normalizeJiraProjectCategoryBody(oOptions),
|
|
1099
|
+
}, sJiraInstance));
|
|
1100
|
+
});
|
|
1101
|
+
}
|
|
1102
|
+
|
|
1103
|
+
export async function removeJiraProjectCategory(iId, oOptions) {
|
|
1104
|
+
return _dbgWrap('removeJiraProjectCategory', [iId, oOptions], async function() {
|
|
1105
|
+
if (isJiraObject(iId)) {
|
|
1106
|
+
oOptions = iId;
|
|
1107
|
+
iId = pickJiraValue(oOptions.id, oOptions.categoryId);
|
|
1108
|
+
}
|
|
1109
|
+
|
|
1110
|
+
oOptions = isJiraObject(oOptions) ? oOptions : {};
|
|
1111
|
+
const sJiraInstance = normalizeJiraInstance(oOptions);
|
|
1112
|
+
return execJiraOp(sJiraInstance ? "RemoveProjectCategory_V2" : "RemoveProjectCategory", withJiraInstance({
|
|
1113
|
+
id: iId,
|
|
1114
|
+
}, sJiraInstance));
|
|
1115
|
+
});
|
|
1116
|
+
}
|
|
1117
|
+
|
|
1118
|
+
export async function listJiraStatuses(oOptions = {}) {
|
|
1119
|
+
return _dbgWrap('listJiraStatuses', [oOptions], async function() {
|
|
1120
|
+
const sJiraInstance = normalizeJiraInstance(oOptions);
|
|
1121
|
+
const sOperationName = sJiraInstance ? "ListStatuses_V2" : "ListStatuses";
|
|
1122
|
+
return execJiraOp(sOperationName, withJiraInstance({
|
|
1123
|
+
projectId: pickJiraValue(oOptions.projectId, oOptions.project, oOptions.id),
|
|
1124
|
+
issueType: pickJiraValue(oOptions.issueType, oOptions.issueTypeId),
|
|
1125
|
+
}, sJiraInstance));
|
|
1126
|
+
});
|
|
1127
|
+
}
|
|
1128
|
+
|
|
1129
|
+
export async function listJiraProjectUsers(oOptions = {}) {
|
|
1130
|
+
return _dbgWrap('listJiraProjectUsers', [oOptions], async function() {
|
|
1131
|
+
const sJiraInstance = normalizeJiraInstance(oOptions);
|
|
1132
|
+
const sOperationName = sJiraInstance ? "ListProjectUsers_V2" : "ListProjectUsers";
|
|
1133
|
+
return execJiraOp(sOperationName, withJiraInstance({
|
|
1134
|
+
projectKey: pickJiraValue(oOptions.projectKey, oOptions.project, oOptions.key),
|
|
1135
|
+
}, sJiraInstance));
|
|
1136
|
+
});
|
|
1137
|
+
}
|
|
1138
|
+
|
|
1139
|
+
export async function listJiraAssignableUsers(oOptions = {}) {
|
|
1140
|
+
return _dbgWrap('listJiraAssignableUsers', [oOptions], async function() {
|
|
1141
|
+
const sJiraInstance = normalizeJiraInstance(oOptions);
|
|
1142
|
+
const sOperationName = sJiraInstance ? "ListAssignableUsers_V2" : "ListAssignableUsers";
|
|
1143
|
+
return execJiraOp(sOperationName, withJiraInstance({
|
|
1144
|
+
projectKey: pickJiraValue(oOptions.projectKey, oOptions.project, oOptions.key),
|
|
1145
|
+
}, sJiraInstance));
|
|
1146
|
+
});
|
|
1147
|
+
}
|
|
1148
|
+
|
|
1149
|
+
export async function listJiraPriorityTypes(oOptions) {
|
|
1150
|
+
return _dbgWrap('listJiraPriorityTypes', [oOptions], async function() {
|
|
1151
|
+
const sJiraInstance = normalizeJiraInstance(oOptions);
|
|
1152
|
+
return execJiraOp(sJiraInstance ? "ListPriorityTypes_V2" : "ListPriorityTypes", withJiraInstance({}, sJiraInstance));
|
|
1153
|
+
});
|
|
1154
|
+
}
|
|
1155
|
+
|
|
1156
|
+
export async function listJiraResources() {
|
|
1157
|
+
return _dbgWrap('listJiraResources', [], async function() {
|
|
1158
|
+
return execJiraOp("ListResources", {});
|
|
1159
|
+
});
|
|
1160
|
+
}
|
|
1161
|
+
|
|
1162
|
+
export async function listJiraIssuesDatacenter(oOptions = {}) {
|
|
1163
|
+
return _dbgWrap('listJiraIssuesDatacenter', [oOptions], async function() {
|
|
1164
|
+
return execJiraOp("ListIssues_Datacenter", withJiraInstance({}, normalizeJiraInstance(oOptions)));
|
|
1165
|
+
});
|
|
1166
|
+
}
|
|
1167
|
+
|
|
1168
|
+
export async function listJiraTransitions(sIssueIdOrKey, oOptions = {}) {
|
|
1169
|
+
return _dbgWrap('listJiraTransitions', [sIssueIdOrKey, oOptions], async function() {
|
|
1170
|
+
if (isJiraObject(sIssueIdOrKey)) {
|
|
1171
|
+
oOptions = sIssueIdOrKey;
|
|
1172
|
+
sIssueIdOrKey = pickJiraValue(oOptions.issueIdOrKey, oOptions.issueKey, oOptions.id, oOptions.key);
|
|
1173
|
+
}
|
|
1174
|
+
|
|
1175
|
+
return execJiraOp("ListTransitions", withJiraInstance({
|
|
1176
|
+
issueIdOrKey: sIssueIdOrKey,
|
|
1177
|
+
}, normalizeJiraInstance(oOptions)));
|
|
1178
|
+
});
|
|
1179
|
+
}
|
|
1180
|
+
|
|
1181
|
+
export async function transitionJiraIssue(sIssueIdOrKey, oOptions = {}) {
|
|
1182
|
+
return _dbgWrap('transitionJiraIssue', [sIssueIdOrKey, oOptions], async function() {
|
|
1183
|
+
if (isJiraObject(sIssueIdOrKey)) {
|
|
1184
|
+
oOptions = sIssueIdOrKey;
|
|
1185
|
+
sIssueIdOrKey = pickJiraValue(oOptions.issueIdOrKey, oOptions.issueKey, oOptions.id, oOptions.key);
|
|
1186
|
+
}
|
|
1187
|
+
|
|
1188
|
+
return execJiraOp("UpdateTransition", withJiraInstance({
|
|
1189
|
+
issueIdOrKey: sIssueIdOrKey,
|
|
1190
|
+
body: normalizeJiraTransitionBody(oOptions),
|
|
1191
|
+
}, normalizeJiraInstance(oOptions)));
|
|
1192
|
+
});
|
|
1193
|
+
}
|
|
1194
|
+
|
|
1195
|
+
export async function onNewJiraIssue(oOptions = {}) {
|
|
1196
|
+
return _dbgWrap('onNewJiraIssue', [oOptions], async function() {
|
|
1197
|
+
const sJiraInstance = normalizeJiraInstance(oOptions);
|
|
1198
|
+
const sOperationName = oOptions.datacenter ? "OnNewIssue_Datacenter" : (sJiraInstance ? "OnNewIssue_V2" : "OnNewIssue");
|
|
1199
|
+
return execJiraOp(sOperationName, withJiraInstance({
|
|
1200
|
+
projectKey: pickJiraValue(oOptions.projectKey, oOptions.project, oOptions.key),
|
|
1201
|
+
}, sJiraInstance));
|
|
1202
|
+
});
|
|
1203
|
+
}
|
|
1204
|
+
|
|
1205
|
+
export async function onClosedJiraIssue(oOptions = {}) {
|
|
1206
|
+
return _dbgWrap('onClosedJiraIssue', [oOptions], async function() {
|
|
1207
|
+
const sJiraInstance = normalizeJiraInstance(oOptions);
|
|
1208
|
+
const sOperationName = oOptions.datacenter ? "OnCloseIssue_Datacenter" : (sJiraInstance ? "OnCloseIssue_V2" : "OnCloseIssue");
|
|
1209
|
+
return execJiraOp(sOperationName, withJiraInstance({
|
|
1210
|
+
projectKey: pickJiraValue(oOptions.projectKey, oOptions.project, oOptions.key),
|
|
1211
|
+
}, sJiraInstance));
|
|
1212
|
+
});
|
|
1213
|
+
}
|
|
1214
|
+
|
|
1215
|
+
export async function onUpdatedJiraIssue(oOptions = {}) {
|
|
1216
|
+
return _dbgWrap('onUpdatedJiraIssue', [oOptions], async function() {
|
|
1217
|
+
const sJiraInstance = normalizeJiraInstance(oOptions);
|
|
1218
|
+
const sOperationName = oOptions.datacenter ? "OnUpdateIssue_Datacenter" : (sJiraInstance ? "OnUpdateIssue_V2" : "OnUpdateIssue");
|
|
1219
|
+
return execJiraOp(sOperationName, withJiraInstance({
|
|
1220
|
+
projectKey: pickJiraValue(oOptions.projectKey, oOptions.project, oOptions.key),
|
|
1221
|
+
}, sJiraInstance));
|
|
1222
|
+
});
|
|
1223
|
+
}
|
|
1224
|
+
|
|
1225
|
+
export async function onNewJiraIssueFromJql(oOptions = {}) {
|
|
1226
|
+
return _dbgWrap('onNewJiraIssueFromJql', [oOptions], async function() {
|
|
1227
|
+
const sJiraInstance = normalizeJiraInstance(oOptions);
|
|
1228
|
+
const sOperationName = oOptions.datacenter ? "OnNewIssueJQL_Datacenter" : (sJiraInstance ? "OnNewIssueJQL_V2" : "OnNewIssueJQL");
|
|
1229
|
+
return execJiraOp(sOperationName, withJiraInstance({
|
|
1230
|
+
jql: pickJiraValue(oOptions.jql, oOptions.query),
|
|
1231
|
+
}, sJiraInstance));
|
|
1232
|
+
});
|
|
1233
|
+
}
|
|
1234
|
+
|
|
1235
|
+
export async function manageJiraIssues(queryRequest, sessionId) {
|
|
1236
|
+
return _dbgWrap('manageJiraIssues', [queryRequest, sessionId], async function() {
|
|
1237
|
+
if (isJiraObject(queryRequest) && sessionId === undefined && (Object.prototype.hasOwnProperty.call(queryRequest, "queryRequest") || Object.prototype.hasOwnProperty.call(queryRequest, "sessionId"))) {
|
|
1238
|
+
sessionId = queryRequest.sessionId;
|
|
1239
|
+
queryRequest = pickJiraValue(queryRequest.queryRequest, queryRequest.body, queryRequest);
|
|
1240
|
+
}
|
|
1241
|
+
|
|
1242
|
+
return execJiraOp("mcp_JiraIssueManagement", {
|
|
1243
|
+
queryRequest,
|
|
1244
|
+
sessionId,
|
|
1245
|
+
});
|
|
1246
|
+
});
|
|
1247
|
+
}
|