@activepieces/piece-jira-cloud 0.3.5 → 0.3.7
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/package.json +7 -18
- package/src/index.js +109 -71
- package/src/auth.d.ts +0 -8
- package/src/auth.d.ts.map +0 -1
- package/src/auth.js +0 -62
- package/src/auth.js.map +0 -1
- package/src/index.d.ts +0 -6
- package/src/index.d.ts.map +0 -1
- package/src/index.js.map +0 -1
- package/src/lib/actions/add-attachment-to-issue.d.ts +0 -26
- package/src/lib/actions/add-attachment-to-issue.d.ts.map +0 -1
- package/src/lib/actions/add-attachment-to-issue.js +0 -41
- package/src/lib/actions/add-attachment-to-issue.js.map +0 -1
- package/src/lib/actions/add-comment-to-issue.d.ts +0 -27
- package/src/lib/actions/add-comment-to-issue.d.ts.map +0 -1
- package/src/lib/actions/add-comment-to-issue.js +0 -65
- package/src/lib/actions/add-comment-to-issue.js.map +0 -1
- package/src/lib/actions/add-watcher-to-issue.d.ts +0 -25
- package/src/lib/actions/add-watcher-to-issue.d.ts.map +0 -1
- package/src/lib/actions/add-watcher-to-issue.js +0 -48
- package/src/lib/actions/add-watcher-to-issue.js.map +0 -1
- package/src/lib/actions/assign-issue.d.ts +0 -34
- package/src/lib/actions/assign-issue.d.ts.map +0 -1
- package/src/lib/actions/assign-issue.js +0 -39
- package/src/lib/actions/assign-issue.js.map +0 -1
- package/src/lib/actions/create-issue.d.ts +0 -35
- package/src/lib/actions/create-issue.d.ts.map +0 -1
- package/src/lib/actions/create-issue.js +0 -132
- package/src/lib/actions/create-issue.js.map +0 -1
- package/src/lib/actions/delete-issue-comment.d.ts +0 -30
- package/src/lib/actions/delete-issue-comment.d.ts.map +0 -1
- package/src/lib/actions/delete-issue-comment.js +0 -64
- package/src/lib/actions/delete-issue-comment.js.map +0 -1
- package/src/lib/actions/find-user.d.ts +0 -8
- package/src/lib/actions/find-user.d.ts.map +0 -1
- package/src/lib/actions/find-user.js +0 -37
- package/src/lib/actions/find-user.js.map +0 -1
- package/src/lib/actions/get-issue-attachment.d.ts +0 -8
- package/src/lib/actions/get-issue-attachment.d.ts.map +0 -1
- package/src/lib/actions/get-issue-attachment.js +0 -48
- package/src/lib/actions/get-issue-attachment.js.map +0 -1
- package/src/lib/actions/get-issue.d.ts +0 -28
- package/src/lib/actions/get-issue.d.ts.map +0 -1
- package/src/lib/actions/get-issue.js +0 -123
- package/src/lib/actions/get-issue.js.map +0 -1
- package/src/lib/actions/link-issues.d.ts +0 -34
- package/src/lib/actions/link-issues.d.ts.map +0 -1
- package/src/lib/actions/link-issues.js +0 -51
- package/src/lib/actions/link-issues.js.map +0 -1
- package/src/lib/actions/list-issue-comments.d.ts +0 -27
- package/src/lib/actions/list-issue-comments.d.ts.map +0 -1
- package/src/lib/actions/list-issue-comments.js +0 -60
- package/src/lib/actions/list-issue-comments.js.map +0 -1
- package/src/lib/actions/markdown-to-jira-format.d.ts +0 -4
- package/src/lib/actions/markdown-to-jira-format.d.ts.map +0 -1
- package/src/lib/actions/markdown-to-jira-format.js +0 -37
- package/src/lib/actions/markdown-to-jira-format.js.map +0 -1
- package/src/lib/actions/search-issues.d.ts +0 -13
- package/src/lib/actions/search-issues.d.ts.map +0 -1
- package/src/lib/actions/search-issues.js +0 -92
- package/src/lib/actions/search-issues.js.map +0 -1
- package/src/lib/actions/transition-issue.d.ts +0 -34
- package/src/lib/actions/transition-issue.d.ts.map +0 -1
- package/src/lib/actions/transition-issue.js +0 -45
- package/src/lib/actions/transition-issue.js.map +0 -1
- package/src/lib/actions/update-issue-comment.d.ts +0 -32
- package/src/lib/actions/update-issue-comment.d.ts.map +0 -1
- package/src/lib/actions/update-issue-comment.js +0 -98
- package/src/lib/actions/update-issue-comment.js.map +0 -1
- package/src/lib/actions/update-issue.d.ts +0 -35
- package/src/lib/actions/update-issue.d.ts.map +0 -1
- package/src/lib/actions/update-issue.js +0 -156
- package/src/lib/actions/update-issue.js.map +0 -1
- package/src/lib/common/index.d.ts +0 -86
- package/src/lib/common/index.d.ts.map +0 -1
- package/src/lib/common/index.js +0 -288
- package/src/lib/common/index.js.map +0 -1
- package/src/lib/common/props.d.ts +0 -96
- package/src/lib/common/props.d.ts.map +0 -1
- package/src/lib/common/props.js +0 -591
- package/src/lib/common/props.js.map +0 -1
- package/src/lib/common/types.d.ts +0 -28
- package/src/lib/common/types.d.ts.map +0 -1
- package/src/lib/common/types.js +0 -26
- package/src/lib/common/types.js.map +0 -1
- package/src/lib/triggers/issue-assigned.d.ts +0 -71
- package/src/lib/triggers/issue-assigned.d.ts.map +0 -1
- package/src/lib/triggers/issue-assigned.js +0 -305
- package/src/lib/triggers/issue-assigned.js.map +0 -1
- package/src/lib/triggers/new-attachment.d.ts +0 -31
- package/src/lib/triggers/new-attachment.d.ts.map +0 -1
- package/src/lib/triggers/new-attachment.js +0 -164
- package/src/lib/triggers/new-attachment.js.map +0 -1
- package/src/lib/triggers/new-comment.d.ts +0 -31
- package/src/lib/triggers/new-comment.d.ts.map +0 -1
- package/src/lib/triggers/new-comment.js +0 -98
- package/src/lib/triggers/new-comment.js.map +0 -1
- package/src/lib/triggers/new-issue.d.ts +0 -31
- package/src/lib/triggers/new-issue.d.ts.map +0 -1
- package/src/lib/triggers/new-issue.js +0 -67
- package/src/lib/triggers/new-issue.js.map +0 -1
- package/src/lib/triggers/updated-issue-status.d.ts +0 -31
- package/src/lib/triggers/updated-issue-status.d.ts.map +0 -1
- package/src/lib/triggers/updated-issue-status.js +0 -67
- package/src/lib/triggers/updated-issue-status.js.map +0 -1
- package/src/lib/triggers/updated-issue.d.ts +0 -31
- package/src/lib/triggers/updated-issue.d.ts.map +0 -1
- package/src/lib/triggers/updated-issue.js +0 -67
- package/src/lib/triggers/updated-issue.js.map +0 -1
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.markdownToJiraFormat = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const schema_default_1 = require("@atlaskit/adf-schema/schema-default");
|
|
7
|
-
const editor_json_transformer_1 = require("@atlaskit/editor-json-transformer");
|
|
8
|
-
const editor_markdown_transformer_1 = require("@atlaskit/editor-markdown-transformer");
|
|
9
|
-
exports.markdownToJiraFormat = (0, pieces_framework_1.createAction)({
|
|
10
|
-
name: 'markdownToJiraFormat',
|
|
11
|
-
displayName: 'Markdown to Jira format',
|
|
12
|
-
description: "Convert Markdown-formatted text to Jira's ADF syntax for use in comments and descriptions etc",
|
|
13
|
-
requireAuth: false,
|
|
14
|
-
props: {
|
|
15
|
-
markdown: pieces_framework_1.Property.LongText({
|
|
16
|
-
displayName: 'Markdown text',
|
|
17
|
-
required: true,
|
|
18
|
-
}),
|
|
19
|
-
},
|
|
20
|
-
errorHandlingOptions: {
|
|
21
|
-
continueOnFailure: {
|
|
22
|
-
defaultValue: false,
|
|
23
|
-
},
|
|
24
|
-
retryOnFailure: {
|
|
25
|
-
hide: true,
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
run(_a) {
|
|
29
|
-
return tslib_1.__awaiter(this, arguments, void 0, function* ({ propsValue }) {
|
|
30
|
-
const jsonTransformer = new editor_json_transformer_1.JSONTransformer();
|
|
31
|
-
const markdownTransformer = new editor_markdown_transformer_1.MarkdownTransformer(schema_default_1.defaultSchema);
|
|
32
|
-
const adfDocument = jsonTransformer.encode(markdownTransformer.parse(propsValue.markdown));
|
|
33
|
-
return adfDocument;
|
|
34
|
-
});
|
|
35
|
-
},
|
|
36
|
-
});
|
|
37
|
-
//# sourceMappingURL=markdown-to-jira-format.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"markdown-to-jira-format.js","sourceRoot":"","sources":["../../../../src/lib/actions/markdown-to-jira-format.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,wEAAoE;AACpE,+EAAoE;AACpE,uFAA4E;AAE/D,QAAA,oBAAoB,GAAG,IAAA,+BAAY,EAAC;IAC/C,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EAAE,yBAAyB;IACtC,WAAW,EACT,+FAA+F;IACjG,WAAW,EAAE,KAAK;IAClB,KAAK,EAAE;QACL,QAAQ,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YAC1B,WAAW,EAAE,eAAe;YAC5B,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACD,oBAAoB,EAAE;QACpB,iBAAiB,EAAE;YACjB,YAAY,EAAE,KAAK;SACpB;QACD,cAAc,EAAE;YACd,IAAI,EAAE,IAAI;SACX;KACF;IACK,GAAG;qEAAC,EAAE,UAAU,EAAE;YACtB,MAAM,eAAe,GAAG,IAAI,yCAAe,EAAE,CAAC;YAC9C,MAAM,mBAAmB,GAAG,IAAI,iDAAmB,CAAC,8BAAoB,CAAC,CAAC;YAE1E,MAAM,WAAW,GAAG,eAAe,CAAC,MAAM,CACxC,mBAAmB,CAAC,KAAK,CAAC,UAAU,CAAC,QAAQ,CAAC,CAC/C,CAAC;YAEF,OAAO,WAAW,CAAC;QACrB,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export declare const searchIssues: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
2
|
-
instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
-
email: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
|
-
apiToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
5
|
-
}>, {
|
|
6
|
-
memoryWarning: import("@activepieces/pieces-framework/dist/src/lib/property/input/markdown-property").MarkDownProperty;
|
|
7
|
-
jql: import("@activepieces/pieces-framework").LongTextProperty<true>;
|
|
8
|
-
fields: import("@activepieces/pieces-framework").ArrayProperty<false>;
|
|
9
|
-
mapNames: import("@activepieces/pieces-framework").CheckboxProperty<true>;
|
|
10
|
-
maxResults: import("@activepieces/pieces-framework").NumberProperty<true>;
|
|
11
|
-
sanitizeJql: import("@activepieces/pieces-framework").CheckboxProperty<true>;
|
|
12
|
-
}>;
|
|
13
|
-
//# sourceMappingURL=search-issues.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"search-issues.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/search-issues.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,YAAY;;;;;;;;;;;EA0FvB,CAAC"}
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.searchIssues = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const shared_1 = require("@activepieces/shared");
|
|
7
|
-
const auth_1 = require("../../auth");
|
|
8
|
-
const common_1 = require("../common");
|
|
9
|
-
const zod_1 = require("zod");
|
|
10
|
-
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
11
|
-
exports.searchIssues = (0, pieces_framework_1.createAction)({
|
|
12
|
-
name: 'search_issues',
|
|
13
|
-
displayName: 'Search Issues',
|
|
14
|
-
description: 'Search for issues with JQL',
|
|
15
|
-
auth: auth_1.jiraCloudAuth,
|
|
16
|
-
props: {
|
|
17
|
-
memoryWarning: pieces_framework_1.Property.MarkDown({
|
|
18
|
-
value: `Fetching a large number of issues without specifying **Fields to Return** may exceed your flow's memory limits. Use field selection to reduce payload size.`,
|
|
19
|
-
variant: shared_1.MarkdownVariant.WARNING,
|
|
20
|
-
}),
|
|
21
|
-
jql: pieces_framework_1.Property.LongText({
|
|
22
|
-
displayName: 'JQL',
|
|
23
|
-
description: "The JQL query to use in search (Tip: Use single quotes for strings/dates)",
|
|
24
|
-
defaultValue: `type = story and created > '2023-12-13 14:00'`,
|
|
25
|
-
required: true,
|
|
26
|
-
}),
|
|
27
|
-
fields: pieces_framework_1.Property.Array({
|
|
28
|
-
displayName: 'Fields to Return',
|
|
29
|
-
description: `List of exact Jira Field IDs to return (e.g., 'summary', 'customfield_10016').
|
|
30
|
-
Special commands:
|
|
31
|
-
- Use *all for every field.
|
|
32
|
-
- Use *navigable for standard fields (default).
|
|
33
|
-
- Prefix with a minus to exclude (e.g., -description).
|
|
34
|
-
Example: *all and -comment returns everything except comments.`,
|
|
35
|
-
required: false,
|
|
36
|
-
}),
|
|
37
|
-
mapNames: pieces_framework_1.Property.Checkbox({
|
|
38
|
-
displayName: 'Map Field Names',
|
|
39
|
-
description: `Map human readable names to Fields in the output.\nNotes:\n- If there are fields with the same name, they may be overridden.`,
|
|
40
|
-
required: true,
|
|
41
|
-
defaultValue: false,
|
|
42
|
-
}),
|
|
43
|
-
maxResults: pieces_framework_1.Property.Number({
|
|
44
|
-
displayName: 'Max Results',
|
|
45
|
-
defaultValue: 50,
|
|
46
|
-
required: true,
|
|
47
|
-
}),
|
|
48
|
-
sanitizeJql: pieces_framework_1.Property.Checkbox({
|
|
49
|
-
displayName: 'Sanitize JQL',
|
|
50
|
-
required: true,
|
|
51
|
-
defaultValue: true,
|
|
52
|
-
}),
|
|
53
|
-
},
|
|
54
|
-
run: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth, propsValue }) {
|
|
55
|
-
yield pieces_common_1.propsValidation.validateZod(propsValue, {
|
|
56
|
-
maxResults: zod_1.z.number().min(1).max(5000),
|
|
57
|
-
});
|
|
58
|
-
const { jql, maxResults, sanitizeJql, fields, mapNames } = propsValue;
|
|
59
|
-
const fieldList = fields;
|
|
60
|
-
const expandParams = mapNames ? ['names'] : [];
|
|
61
|
-
const allIssues = [];
|
|
62
|
-
let nextPageToken;
|
|
63
|
-
const PAGE_SIZE = 100;
|
|
64
|
-
while (allIssues.length < maxResults) {
|
|
65
|
-
const limit = Math.min(PAGE_SIZE, maxResults - allIssues.length);
|
|
66
|
-
const response = yield (0, common_1.searchIssuesByJql)({
|
|
67
|
-
auth,
|
|
68
|
-
jql,
|
|
69
|
-
maxResults: limit,
|
|
70
|
-
sanitizeJql,
|
|
71
|
-
nextPageToken,
|
|
72
|
-
fields: fieldList,
|
|
73
|
-
expand: expandParams,
|
|
74
|
-
});
|
|
75
|
-
const fetchedIssues = response.issues;
|
|
76
|
-
const fieldNames = response.names || {};
|
|
77
|
-
if (mapNames && Object.keys(fieldNames).length > 0) {
|
|
78
|
-
for (const issue of fetchedIssues) {
|
|
79
|
-
if (issue.fields) {
|
|
80
|
-
issue.fields = (0, common_1.mapFieldNames)(issue.fields, fieldNames);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
allIssues.push(...fetchedIssues);
|
|
85
|
-
nextPageToken = response.nextPageToken;
|
|
86
|
-
if (!nextPageToken || fetchedIssues.length === 0)
|
|
87
|
-
break;
|
|
88
|
-
}
|
|
89
|
-
return allIssues;
|
|
90
|
-
}),
|
|
91
|
-
});
|
|
92
|
-
//# sourceMappingURL=search-issues.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"search-issues.js","sourceRoot":"","sources":["../../../../src/lib/actions/search-issues.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,iDAAuD;AACvD,qCAA2C;AAC3C,sCAA6D;AAC7D,6BAAwB;AACxB,+DAA8D;AAEjD,QAAA,YAAY,GAAG,IAAA,+BAAY,EAAC;IACvC,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,eAAe;IAC5B,WAAW,EAAE,4BAA4B;IACzC,IAAI,EAAE,oBAAa;IACnB,KAAK,EAAE;QACL,aAAa,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YAC/B,KAAK,EAAE,6JAA6J;YACpK,OAAO,EAAE,wBAAe,CAAC,OAAO;SACjC,CAAC;QACF,GAAG,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACrB,WAAW,EAAE,KAAK;YAClB,WAAW,EAAE,2EAA2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,MAAM,GAAG,UAAU,EAAE,CAAC;YACrC,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,UAAU,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;YAEjE,MAAM,QAAQ,GAAG,MAAM,IAAA,0BAAiB,EAAC;gBACvC,IAAI;gBACJ,GAAG;gBACH,UAAU,EAAE,KAAK;gBACjB,WAAW;gBACX,aAAa;gBACb,MAAM,EAAE,SAAS;gBACjB,MAAM,EAAE,YAAY;aACrB,CAAC,CAAC;YAEH,MAAM,aAAa,GAAG,QAAQ,CAAC,MAAM,CAAC;YACtC,MAAM,UAAU,GAAG,QAAQ,CAAC,KAAK,IAAI,EAAE,CAAC;YAExC,IAAI,QAAQ,IAAI,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACnD,KAAK,MAAM,KAAK,IAAI,aAAa,EAAE,CAAC;oBAClC,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;wBACjB,KAAK,CAAC,MAAM,GAAG,IAAA,sBAAa,EAAC,KAAK,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;oBACzD,CAAC;gBACH,CAAC;YACH,CAAC;YAED,SAAS,CAAC,IAAI,CAAC,GAAG,aAAa,CAAC,CAAC;YACjC,aAAa,GAAG,QAAQ,CAAC,aAAa,CAAC;YAEvC,IAAI,CAAC,aAAa,IAAI,aAAa,CAAC,MAAM,KAAK,CAAC;gBAAE,MAAM;QAC1D,CAAC;QAED,OAAO,SAAS,CAAC;IACnB,CAAC,CAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
export declare const transitionIssueAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
2
|
-
instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
-
email: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
|
-
apiToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
5
|
-
}>, {
|
|
6
|
-
projectId: import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
7
|
-
instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
8
|
-
email: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
9
|
-
apiToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
10
|
-
}>> | import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
11
|
-
instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
12
|
-
email: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
13
|
-
apiToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
14
|
-
}>>;
|
|
15
|
-
issueId: import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
16
|
-
instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
17
|
-
email: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
18
|
-
apiToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
19
|
-
}>> | import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
20
|
-
instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
21
|
-
email: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
22
|
-
apiToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
23
|
-
}>>;
|
|
24
|
-
transitionId: import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
25
|
-
instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
26
|
-
email: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
27
|
-
apiToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
28
|
-
}>> | import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
29
|
-
instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
30
|
-
email: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
31
|
-
apiToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
32
|
-
}>>;
|
|
33
|
-
}>;
|
|
34
|
-
//# sourceMappingURL=transition-issue.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"transition-issue.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/transition-issue.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqChC,CAAC"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.transitionIssueAction = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
|
-
const shared_1 = require("@activepieces/shared");
|
|
8
|
-
const auth_1 = require("../../auth");
|
|
9
|
-
const common_1 = require("../common");
|
|
10
|
-
const props_1 = require("../common/props");
|
|
11
|
-
exports.transitionIssueAction = (0, pieces_framework_1.createAction)({
|
|
12
|
-
auth: auth_1.jiraCloudAuth,
|
|
13
|
-
name: 'transition_issue',
|
|
14
|
-
displayName: 'Transition Issue',
|
|
15
|
-
description: 'Moves an issue to a new status by executing a workflow transition.',
|
|
16
|
-
props: {
|
|
17
|
-
projectId: (0, props_1.getProjectIdDropdown)(),
|
|
18
|
-
issueId: (0, props_1.getIssueIdDropdown)({ refreshers: ['projectId'] }),
|
|
19
|
-
transitionId: (0, props_1.issueStatusIdProp)('Transition', true),
|
|
20
|
-
},
|
|
21
|
-
run(context) {
|
|
22
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
23
|
-
const { issueId, transitionId } = context.propsValue;
|
|
24
|
-
if ((0, shared_1.isNil)(issueId) || (0, shared_1.isNil)(transitionId)) {
|
|
25
|
-
throw new Error('Issue and Transition are required');
|
|
26
|
-
}
|
|
27
|
-
const body = {
|
|
28
|
-
transition: { id: transitionId },
|
|
29
|
-
};
|
|
30
|
-
yield (0, common_1.jiraApiCall)({
|
|
31
|
-
auth: context.auth,
|
|
32
|
-
method: pieces_common_1.HttpMethod.POST,
|
|
33
|
-
resourceUri: `/issue/${issueId}/transitions`,
|
|
34
|
-
body,
|
|
35
|
-
});
|
|
36
|
-
const issue = yield (0, common_1.jiraApiCall)({
|
|
37
|
-
auth: context.auth,
|
|
38
|
-
method: pieces_common_1.HttpMethod.GET,
|
|
39
|
-
resourceUri: `/issue/${issueId}`,
|
|
40
|
-
});
|
|
41
|
-
return { success: true, issue };
|
|
42
|
-
});
|
|
43
|
-
},
|
|
44
|
-
});
|
|
45
|
-
//# sourceMappingURL=transition-issue.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"transition-issue.js","sourceRoot":"","sources":["../../../../src/lib/actions/transition-issue.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyD;AACzD,iDAA6C;AAC7C,qCAA2C;AAC3C,sCAAwC;AACxC,2CAIyB;AAEZ,QAAA,qBAAqB,GAAG,IAAA,+BAAY,EAAC;IAChD,IAAI,EAAE,oBAAa;IACnB,IAAI,EAAE,kBAAkB;IACxB,WAAW,EAAE,kBAAkB;IAC/B,WAAW,EACT,oEAAoE;IACtE,KAAK,EAAE;QACL,SAAS,EAAE,IAAA,4BAAoB,GAAE;QACjC,OAAO,EAAE,IAAA,0BAAkB,EAAC,EAAE,UAAU,EAAE,CAAC,WAAW,CAAC,EAAE,CAAC;QAC1D,YAAY,EAAE,IAAA,yBAAiB,EAAC,YAAY,EAAE,IAAI,CAAC;KACpD;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAErD,IAAI,IAAA,cAAK,EAAC,OAAO,CAAC,IAAI,IAAA,cAAK,EAAC,YAAY,CAAC,EAAE,CAAC;gBAC1C,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAC;YACvD,CAAC;YAED,MAAM,IAAI,GAA4B;gBACpC,UAAU,EAAE,EAAE,EAAE,EAAE,YAAY,EAAE;aACjC,CAAC;YAEF,MAAM,IAAA,oBAAW,EAAC;gBAChB,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,WAAW,EAAE,UAAU,OAAO,cAAc;gBAC5C,IAAI;aACL,CAAC,CAAC;YAEH,MAAM,KAAK,GAAG,MAAM,IAAA,oBAAW,EAAC;gBAC9B,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,WAAW,EAAE,UAAU,OAAO,EAAE;aACjC,CAAC,CAAC;YAEH,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;QAClC,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
export declare const updateIssueCommentAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
2
|
-
instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
-
email: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
|
-
apiToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
5
|
-
}>, {
|
|
6
|
-
projectId: import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
7
|
-
instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
8
|
-
email: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
9
|
-
apiToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
10
|
-
}>> | import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
11
|
-
instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
12
|
-
email: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
13
|
-
apiToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
14
|
-
}>>;
|
|
15
|
-
issueId: import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
16
|
-
instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
17
|
-
email: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
18
|
-
apiToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
19
|
-
}>> | import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
20
|
-
instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
21
|
-
email: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
22
|
-
apiToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
23
|
-
}>>;
|
|
24
|
-
commentId: import("@activepieces/pieces-framework").DropdownProperty<any, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
25
|
-
instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
26
|
-
email: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
27
|
-
apiToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
28
|
-
}>>;
|
|
29
|
-
comment: import("@activepieces/pieces-framework").LongTextProperty<true>;
|
|
30
|
-
isADF: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
31
|
-
}>;
|
|
32
|
-
//# sourceMappingURL=update-issue-comment.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"update-issue-comment.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/update-issue-comment.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwFnC,CAAC"}
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.updateIssueCommentAction = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const auth_1 = require("../../auth");
|
|
7
|
-
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
8
|
-
const common_1 = require("../common");
|
|
9
|
-
const props_1 = require("../common/props");
|
|
10
|
-
exports.updateIssueCommentAction = (0, pieces_framework_1.createAction)({
|
|
11
|
-
auth: auth_1.jiraCloudAuth,
|
|
12
|
-
name: 'update_issue_comment',
|
|
13
|
-
displayName: 'Update Issue Comment',
|
|
14
|
-
description: 'Updates a comment to a specific issue.',
|
|
15
|
-
props: {
|
|
16
|
-
projectId: (0, props_1.getProjectIdDropdown)(),
|
|
17
|
-
issueId: (0, props_1.getIssueIdDropdown)({ refreshers: ['projectId'] }),
|
|
18
|
-
commentId: pieces_framework_1.Property.Dropdown({
|
|
19
|
-
auth: auth_1.jiraCloudAuth,
|
|
20
|
-
displayName: 'Comment ID',
|
|
21
|
-
refreshers: ['issueId'],
|
|
22
|
-
required: true,
|
|
23
|
-
options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth, issueId }) {
|
|
24
|
-
if (!auth || !issueId) {
|
|
25
|
-
return {
|
|
26
|
-
disabled: true,
|
|
27
|
-
placeholder: 'Please connect your account and select issue.',
|
|
28
|
-
options: [],
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
const response = yield (0, common_1.sendJiraRequest)({
|
|
32
|
-
method: pieces_common_1.HttpMethod.GET,
|
|
33
|
-
url: `issue/${issueId}/comment`,
|
|
34
|
-
auth: auth,
|
|
35
|
-
queryParams: {
|
|
36
|
-
orderBy: '-created',
|
|
37
|
-
expand: 'renderedBody',
|
|
38
|
-
},
|
|
39
|
-
});
|
|
40
|
-
return {
|
|
41
|
-
disabled: false,
|
|
42
|
-
options: response.body.comments.map((comment) => {
|
|
43
|
-
return {
|
|
44
|
-
label: comment.renderedBody,
|
|
45
|
-
value: comment.id,
|
|
46
|
-
};
|
|
47
|
-
}),
|
|
48
|
-
};
|
|
49
|
-
}),
|
|
50
|
-
}),
|
|
51
|
-
comment: pieces_framework_1.Property.LongText({
|
|
52
|
-
displayName: 'Comment Body',
|
|
53
|
-
required: true,
|
|
54
|
-
}),
|
|
55
|
-
isADF: pieces_framework_1.Property.Checkbox({
|
|
56
|
-
displayName: 'Comment is in JSON Atlassian Document Format',
|
|
57
|
-
description: 'https://developer.atlassian.com/cloud/jira/platform/apis/document/structure',
|
|
58
|
-
required: false,
|
|
59
|
-
defaultValue: false,
|
|
60
|
-
}),
|
|
61
|
-
},
|
|
62
|
-
run(context) {
|
|
63
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
64
|
-
const { issueId, comment, commentId, isADF } = context.propsValue;
|
|
65
|
-
let commentBody = {};
|
|
66
|
-
if (isADF) {
|
|
67
|
-
commentBody = JSON.parse(comment);
|
|
68
|
-
}
|
|
69
|
-
else {
|
|
70
|
-
commentBody = {
|
|
71
|
-
version: 1,
|
|
72
|
-
type: 'doc',
|
|
73
|
-
content: [
|
|
74
|
-
{
|
|
75
|
-
type: 'paragraph',
|
|
76
|
-
content: [
|
|
77
|
-
{
|
|
78
|
-
type: 'text',
|
|
79
|
-
text: comment,
|
|
80
|
-
},
|
|
81
|
-
],
|
|
82
|
-
},
|
|
83
|
-
],
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
const response = yield (0, common_1.sendJiraRequest)({
|
|
87
|
-
method: pieces_common_1.HttpMethod.PUT,
|
|
88
|
-
url: `issue/${issueId}/comment/${commentId}`,
|
|
89
|
-
auth: context.auth,
|
|
90
|
-
body: {
|
|
91
|
-
body: commentBody,
|
|
92
|
-
},
|
|
93
|
-
});
|
|
94
|
-
return response.body;
|
|
95
|
-
});
|
|
96
|
-
},
|
|
97
|
-
});
|
|
98
|
-
//# sourceMappingURL=update-issue-comment.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"update-issue-comment.js","sourceRoot":"","sources":["../../../../src/lib/actions/update-issue-comment.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,qCAA2C;AAC3C,+DAAyD;AACzD,sCAA4C;AAC5C,2CAA2E;AAE9D,QAAA,wBAAwB,GAAG,IAAA,+BAAY,EAAC;IACpD,IAAI,EAAE,oBAAa;IACnB,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EAAE,sBAAsB;IACnC,WAAW,EAAE,wCAAwC;IACrD,KAAK,EAAE;QACN,SAAS,EAAE,IAAA,4BAAoB,GAAE;QACjC,OAAO,EAAE,IAAA,0BAAkB,EAAC,EAAE,UAAU,EAAE,CAAC,WAAW,CAAC,EAAE,CAAC;QAC1D,SAAS,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YAC5B,IAAI,EAAE,oBAAa;YACnB,WAAW,EAAE,YAAY;YACzB,UAAU,EAAE,CAAC,SAAS,CAAC;YACvB,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,KAA0B,EAAE,oDAArB,EAAE,IAAI,EAAE,OAAO,EAAE;gBAChC,IAAI,CAAC,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;oBACvB,OAAO;wBACN,QAAQ,EAAE,IAAI;wBACd,WAAW,EAAE,+CAA+C;wBAC5D,OAAO,EAAE,EAAE;qBACX,CAAC;gBACH,CAAC;gBACD,MAAM,QAAQ,GAAG,MA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EAAE,OAAO;iCACb;6BACD;yBACD;qBACD;iBACD,CAAC;YACH,CAAC;YAED,MAAM,QAAQ,GAAG,MAAM,IAAA,wBAAe,EAAC;gBACtC,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,GAAG,EAAE,SAAS,OAAO,YAAY,SAAS,EAAE;gBAC5C,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,IAAI,EAAE;oBACL,IAAI,EAAE,WAAW;iBACjB;aACD,CAAC,CAAC;YACH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACtB,CAAC;KAAA;CACD,CAAC,CAAC"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
export declare const updateIssueAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
2
|
-
instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
-
email: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
|
-
apiToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
5
|
-
}>, {
|
|
6
|
-
issueId: import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
7
|
-
instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
8
|
-
email: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
9
|
-
apiToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
10
|
-
}>> | import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
11
|
-
instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
12
|
-
email: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
13
|
-
apiToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
14
|
-
}>>;
|
|
15
|
-
statusId: import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
16
|
-
instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
17
|
-
email: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
18
|
-
apiToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
19
|
-
}>> | import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
20
|
-
instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
21
|
-
email: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
22
|
-
apiToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
23
|
-
}>>;
|
|
24
|
-
issueFields: import("@activepieces/pieces-framework").DynamicProperties<true, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
25
|
-
instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
26
|
-
email: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
27
|
-
apiToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
28
|
-
}>>;
|
|
29
|
-
adfFields: import("@activepieces/pieces-framework").MultiSelectDropdownProperty<string, false, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
30
|
-
instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
31
|
-
email: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
32
|
-
apiToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
33
|
-
}>>;
|
|
34
|
-
}>;
|
|
35
|
-
//# sourceMappingURL=update-issue.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"update-issue.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/update-issue.ts"],"names":[],"mappings":"AAkCA,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmJ5B,CAAC"}
|
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.updateIssueAction = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const auth_1 = require("../../auth");
|
|
7
|
-
const props_1 = require("../common/props");
|
|
8
|
-
const common_1 = require("../common");
|
|
9
|
-
const types_1 = require("../common/types");
|
|
10
|
-
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
11
|
-
const shared_1 = require("@activepieces/shared");
|
|
12
|
-
function getFields(auth, issueId) {
|
|
13
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
14
|
-
const response = yield (0, common_1.jiraApiCall)({
|
|
15
|
-
auth: auth,
|
|
16
|
-
method: pieces_common_1.HttpMethod.GET,
|
|
17
|
-
resourceUri: `/issue/${issueId}/editmeta`,
|
|
18
|
-
});
|
|
19
|
-
const fields = [];
|
|
20
|
-
for (const key in response.fields) {
|
|
21
|
-
fields.push(response.fields[key]);
|
|
22
|
-
}
|
|
23
|
-
if (!fields || !Array.isArray(fields)) {
|
|
24
|
-
return [];
|
|
25
|
-
}
|
|
26
|
-
return fields;
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
exports.updateIssueAction = (0, pieces_framework_1.createAction)({
|
|
30
|
-
name: 'update_issue',
|
|
31
|
-
displayName: 'Update Issue',
|
|
32
|
-
description: 'Updates an existing issue.',
|
|
33
|
-
auth: auth_1.jiraCloudAuth,
|
|
34
|
-
props: {
|
|
35
|
-
issueId: (0, props_1.issueIdOrKeyProp)('Issue ID or Key', true),
|
|
36
|
-
statusId: (0, props_1.issueStatusIdProp)('Status', false),
|
|
37
|
-
issueFields: pieces_framework_1.Property.DynamicProperties({
|
|
38
|
-
auth: auth_1.jiraCloudAuth,
|
|
39
|
-
displayName: 'Fields',
|
|
40
|
-
required: true,
|
|
41
|
-
refreshers: ['issueId'],
|
|
42
|
-
props: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth, issueId }) {
|
|
43
|
-
if (!auth || !issueId) {
|
|
44
|
-
return {};
|
|
45
|
-
}
|
|
46
|
-
const props = {};
|
|
47
|
-
const authValue = auth;
|
|
48
|
-
const issueIdValue = issueId;
|
|
49
|
-
const fields = yield getFields(authValue, issueIdValue);
|
|
50
|
-
for (const field of fields) {
|
|
51
|
-
// skip invalid custom fields
|
|
52
|
-
if (field.schema.custom) {
|
|
53
|
-
const customFieldType = field.schema.custom.split(':')[1];
|
|
54
|
-
if (!types_1.VALID_CUSTOM_FIELD_TYPES.includes(customFieldType)) {
|
|
55
|
-
continue;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
if (field.key === 'issuetype') {
|
|
59
|
-
props[field.key] = pieces_framework_1.Property.StaticDropdown({
|
|
60
|
-
displayName: field.name,
|
|
61
|
-
required: false,
|
|
62
|
-
options: {
|
|
63
|
-
disabled: false,
|
|
64
|
-
options: field.allowedValues
|
|
65
|
-
? field.allowedValues.map((option) => ({
|
|
66
|
-
label: option.name,
|
|
67
|
-
value: option.id,
|
|
68
|
-
}))
|
|
69
|
-
: [],
|
|
70
|
-
},
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
else {
|
|
74
|
-
props[field.key] = yield (0, props_1.createPropertyDefinition)(authValue, field, false);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
// Remove null props
|
|
78
|
-
return Object.fromEntries(Object.entries(props).filter(([_, prop]) => prop !== null));
|
|
79
|
-
}),
|
|
80
|
-
}),
|
|
81
|
-
adfFields: pieces_framework_1.Property.MultiSelectDropdown({
|
|
82
|
-
auth: auth_1.jiraCloudAuth,
|
|
83
|
-
displayName: 'Fields in JSON Atlassian Document Format',
|
|
84
|
-
description: 'https://developer.atlassian.com/cloud/jira/platform/apis/document/structure',
|
|
85
|
-
required: false,
|
|
86
|
-
refreshers: ['issueId'],
|
|
87
|
-
options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth, issueId }) {
|
|
88
|
-
if (!auth || !issueId) {
|
|
89
|
-
return {
|
|
90
|
-
disabled: true,
|
|
91
|
-
options: [],
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
const authValue = auth;
|
|
95
|
-
const issueIdValue = issueId;
|
|
96
|
-
const fields = yield getFields(authValue, issueIdValue);
|
|
97
|
-
const adfCompatibleFields = fields.filter(props_1.isFieldAdfCompatible);
|
|
98
|
-
const fieldOptions = adfCompatibleFields.map(field => ({
|
|
99
|
-
label: field.name,
|
|
100
|
-
value: field.key,
|
|
101
|
-
}));
|
|
102
|
-
return {
|
|
103
|
-
disabled: false,
|
|
104
|
-
options: fieldOptions,
|
|
105
|
-
};
|
|
106
|
-
}),
|
|
107
|
-
}),
|
|
108
|
-
},
|
|
109
|
-
run(context) {
|
|
110
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
111
|
-
var _a;
|
|
112
|
-
const { issueId, statusId, adfFields } = context.propsValue;
|
|
113
|
-
const inputIssueFields = (_a = context.propsValue.issueFields) !== null && _a !== void 0 ? _a : {};
|
|
114
|
-
if ((0, shared_1.isNil)(issueId)) {
|
|
115
|
-
throw new Error('Issue ID is required');
|
|
116
|
-
}
|
|
117
|
-
if (!(0, shared_1.isNil)(statusId) && statusId !== '') {
|
|
118
|
-
yield (0, common_1.jiraApiCall)({
|
|
119
|
-
auth: context.auth,
|
|
120
|
-
method: pieces_common_1.HttpMethod.POST,
|
|
121
|
-
resourceUri: `/issue/${issueId}/transitions`,
|
|
122
|
-
body: {
|
|
123
|
-
transition: {
|
|
124
|
-
id: statusId,
|
|
125
|
-
},
|
|
126
|
-
},
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
const issueTypeFields = yield (0, common_1.jiraApiCall)({
|
|
130
|
-
auth: context.auth,
|
|
131
|
-
method: pieces_common_1.HttpMethod.GET,
|
|
132
|
-
resourceUri: `/issue/${issueId}/editmeta`,
|
|
133
|
-
});
|
|
134
|
-
const flattenedFields = Object.values(issueTypeFields.fields);
|
|
135
|
-
const formattedAdfFields = adfFields || [];
|
|
136
|
-
const formattedFields = (0, props_1.formatIssueFields)(flattenedFields, inputIssueFields, formattedAdfFields);
|
|
137
|
-
const response = yield (0, common_1.jiraApiCall)({
|
|
138
|
-
auth: context.auth,
|
|
139
|
-
method: pieces_common_1.HttpMethod.PUT,
|
|
140
|
-
resourceUri: `/issue/${issueId}`,
|
|
141
|
-
body: {
|
|
142
|
-
fields: formattedFields,
|
|
143
|
-
},
|
|
144
|
-
query: { returnIssue: 'true' },
|
|
145
|
-
});
|
|
146
|
-
const issue = yield (0, common_1.jiraApiCall)({
|
|
147
|
-
auth: context.auth,
|
|
148
|
-
method: pieces_common_1.HttpMethod.GET,
|
|
149
|
-
resourceUri: `/issue/${issueId}`,
|
|
150
|
-
});
|
|
151
|
-
const updatedIssueProperties = (0, props_1.transformCustomFields)(flattenedFields, issue.fields);
|
|
152
|
-
return Object.assign(Object.assign({}, issue), { fields: updatedIssueProperties });
|
|
153
|
-
});
|
|
154
|
-
},
|
|
155
|
-
});
|
|
156
|
-
//# sourceMappingURL=update-issue.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"update-issue.js","sourceRoot":"","sources":["../../../../src/lib/actions/update-issue.ts"],"names":[],"mappings":";;;;AAAA,qEAA2F;AAC3F,qCAAqD;AACrD,2CAOyB;AACzB,sCAAwC;AACxC,2CAA+E;AAC/E,+DAAyD;AACzD,iDAA6C;AAE7C,SAAe,SAAS,CAAC,IAAc,EAAE,OAAe;;QACvD,MAAM,QAAQ,GAAG,MAAM,IAAA,oBAAW,EAAkD;YACnF,IAAI,EAAE,IAAI;YACV,MAAM,EAAE,0BAAU,CAAC,GAAG;YACtB,WAAW,EAAE,UAAU,OAAO,WAAW;SACzC,CAAC,CAAC;QAEH,MAAM,MAAM,GAAyB,EAAE,CAAC;QACxC,KAAK,MAAM,GAAG,IAAI,QAAQ,CAAC,MAAM,EAAE,CAAC;YACnC,MAAM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