@activepieces/piece-jira-cloud 0.3.1 → 0.3.3
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 +3 -3
- package/src/index.d.ts.map +1 -1
- package/src/index.js +7 -2
- package/src/index.js.map +1 -1
- package/src/lib/actions/link-issues.d.ts.map +1 -1
- package/src/lib/actions/link-issues.js +20 -21
- package/src/lib/actions/link-issues.js.map +1 -1
- package/src/lib/actions/transition-issue.d.ts +34 -0
- package/src/lib/actions/transition-issue.d.ts.map +1 -0
- package/src/lib/actions/transition-issue.js +45 -0
- package/src/lib/actions/transition-issue.js.map +1 -0
- package/src/lib/triggers/issue-assigned.d.ts +71 -0
- package/src/lib/triggers/issue-assigned.d.ts.map +1 -0
- package/src/lib/triggers/issue-assigned.js +305 -0
- package/src/lib/triggers/issue-assigned.js.map +1 -0
- package/src/lib/triggers/new-attachment.d.ts +31 -0
- package/src/lib/triggers/new-attachment.d.ts.map +1 -0
- package/src/lib/triggers/new-attachment.js +164 -0
- package/src/lib/triggers/new-attachment.js.map +1 -0
- package/src/lib/triggers/new-comment.d.ts +31 -0
- package/src/lib/triggers/new-comment.d.ts.map +1 -0
- package/src/lib/triggers/new-comment.js +98 -0
- package/src/lib/triggers/new-comment.js.map +1 -0
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@activepieces/piece-jira-cloud",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.3",
|
|
4
4
|
"main": "./src/index.js",
|
|
5
5
|
"types": "./src/index.d.ts",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@activepieces/pieces-common": "0.12.3",
|
|
8
|
-
"@activepieces/pieces-framework": "0.
|
|
9
|
-
"@activepieces/shared": "0.
|
|
8
|
+
"@activepieces/pieces-framework": "0.28.0",
|
|
9
|
+
"@activepieces/shared": "0.67.1",
|
|
10
10
|
"@atlaskit/adf-schema": "50.4.0",
|
|
11
11
|
"@atlaskit/editor-json-transformer": "8.27.2",
|
|
12
12
|
"@atlaskit/editor-markdown-transformer": "5.16.6",
|
package/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AA4BA,eAAO,MAAM,SAAS;;;;GA0CpB,CAAC"}
|
package/src/index.js
CHANGED
|
@@ -24,6 +24,10 @@ const link_issues_1 = require("./lib/actions/link-issues");
|
|
|
24
24
|
const get_issue_attachment_1 = require("./lib/actions/get-issue-attachment");
|
|
25
25
|
const markdown_to_jira_format_1 = require("./lib/actions/markdown-to-jira-format");
|
|
26
26
|
const get_issue_1 = require("./lib/actions/get-issue");
|
|
27
|
+
const transition_issue_1 = require("./lib/actions/transition-issue");
|
|
28
|
+
const new_comment_1 = require("./lib/triggers/new-comment");
|
|
29
|
+
const issue_assigned_1 = require("./lib/triggers/issue-assigned");
|
|
30
|
+
const new_attachment_1 = require("./lib/triggers/new-attachment");
|
|
27
31
|
exports.jiraCloud = (0, pieces_framework_1.createPiece)({
|
|
28
32
|
displayName: 'Jira Cloud',
|
|
29
33
|
description: 'Issue tracking and project management',
|
|
@@ -31,7 +35,7 @@ exports.jiraCloud = (0, pieces_framework_1.createPiece)({
|
|
|
31
35
|
minimumSupportedRelease: '0.30.0',
|
|
32
36
|
logoUrl: 'https://cdn.activepieces.com/pieces/jira.png',
|
|
33
37
|
categories: [shared_1.PieceCategory.PRODUCTIVITY],
|
|
34
|
-
authors: ['kishanprmr', 'MoShizzle', 'abuaboud', 'prasanna2000-max'],
|
|
38
|
+
authors: ['kishanprmr', 'MoShizzle', 'abuaboud', 'prasanna2000-max', 'sanket-a11y'],
|
|
35
39
|
actions: [
|
|
36
40
|
create_issue_1.createIssueAction,
|
|
37
41
|
update_issue_1.updateIssueAction,
|
|
@@ -48,6 +52,7 @@ exports.jiraCloud = (0, pieces_framework_1.createPiece)({
|
|
|
48
52
|
delete_issue_comment_1.deleteIssueCommentAction,
|
|
49
53
|
markdown_to_jira_format_1.markdownToJiraFormat,
|
|
50
54
|
get_issue_1.getIssueAction,
|
|
55
|
+
transition_issue_1.transitionIssueAction,
|
|
51
56
|
(0, pieces_common_1.createCustomApiCallAction)({
|
|
52
57
|
baseUrl: (auth) => {
|
|
53
58
|
return auth ? `${(auth).props.instanceUrl}/rest/api/3` : '';
|
|
@@ -61,6 +66,6 @@ exports.jiraCloud = (0, pieces_framework_1.createPiece)({
|
|
|
61
66
|
}),
|
|
62
67
|
}),
|
|
63
68
|
],
|
|
64
|
-
triggers: [new_issue_1.newIssue, updated_issue_1.updatedIssue, updated_issue_status_1.updatedIssueStatus],
|
|
69
|
+
triggers: [new_issue_1.newIssue, updated_issue_1.updatedIssue, updated_issue_status_1.updatedIssueStatus, new_comment_1.newComment, issue_assigned_1.issueAssigned, new_attachment_1.newAttachment],
|
|
65
70
|
});
|
|
66
71
|
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAAA,qEAA6D;AAE7D,+DAAwE;AACxE,iDAAqD;AACrD,iCAAiD;AACjD,6DAA+D;AAC/D,+DAA2D;AAC3D,wDAAoD;AACpD,gEAA4D;AAC5D,8EAAyE;AACzE,6EAA6E;AAC7E,mFAAmF;AACnF,6EAA8E;AAC9E,6EAA8E;AAC9E,6DAA+D;AAC/D,6DAA+D;AAC/D,2EAA4E;AAC5E,uDAAyD;AACzD,6EAA6E;AAC7E,2DAA6D;AAC7D,6EAA8E;AAC9E,mFAA6E;AAC7E,uDAAyD;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAAA,qEAA6D;AAE7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CAAC;gBACnC,OAAO;oBACN,aAAa,EAAE,SAAS,MAAM,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC,KAAK,CAAC,KAAK,IAAI,SAAS,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC,QAAQ,CACnG,QAAQ,CACR,EAAE;iBACH,CAAC;YACH,CAAC,CAAA;SACD,CAAC;KACF;IACD,QAAQ,EAAE,CAAC,oBAAQ,EAAE,4BAAY,EAAE,yCAAkB,EAAE,wBAAU,EAAE,8BAAa,EAAE,8BAAa,CAAC;CAChG,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link-issues.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/link-issues.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"link-issues.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/link-issues.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwC3B,CAAC"}
|
|
@@ -24,28 +24,27 @@ exports.linkIssuesAction = (0, pieces_framework_1.createAction)({
|
|
|
24
24
|
if ((0, shared_1.isNil)(firstIssueId) || (0, shared_1.isNil)(issueLinkTypeId) || (0, shared_1.isNil)(secondIssueId)) {
|
|
25
25
|
throw new Error('First Issue, Link Type, and Second Issue are required');
|
|
26
26
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
id: issueLinkTypeId,
|
|
35
|
-
},
|
|
36
|
-
inwardIssue: {
|
|
37
|
-
id: secondIssueId,
|
|
38
|
-
},
|
|
39
|
-
outwardIssue: {
|
|
40
|
-
id: firstIssueId,
|
|
41
|
-
},
|
|
27
|
+
const response = yield (0, common_1.jiraApiCall)({
|
|
28
|
+
method: pieces_common_1.HttpMethod.POST,
|
|
29
|
+
resourceUri: '/issueLink',
|
|
30
|
+
auth: context.auth,
|
|
31
|
+
body: {
|
|
32
|
+
type: {
|
|
33
|
+
id: issueLinkTypeId,
|
|
42
34
|
},
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
35
|
+
inwardIssue: {
|
|
36
|
+
id: secondIssueId,
|
|
37
|
+
},
|
|
38
|
+
outwardIssue: {
|
|
39
|
+
id: firstIssueId,
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
return {
|
|
44
|
+
success: true,
|
|
45
|
+
message: 'Issues linked successfully',
|
|
46
|
+
data: response ? response : null,
|
|
47
|
+
};
|
|
49
48
|
});
|
|
50
49
|
},
|
|
51
50
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link-issues.js","sourceRoot":"","sources":["../../../../src/lib/actions/link-issues.ts"],"names":[],"mappings":";;;;AAAA,qEAA8D;AAC9D,qCAA2C;AAC3C,2CAAwE;AACxE,iDAA6C;AAC7C,+DAAoE;AACpE,sCAAwC;AAE3B,QAAA,gBAAgB,GAAG,IAAA,+BAAY,EAAC;
|
|
1
|
+
{"version":3,"file":"link-issues.js","sourceRoot":"","sources":["../../../../src/lib/actions/link-issues.ts"],"names":[],"mappings":";;;;AAAA,qEAA8D;AAC9D,qCAA2C;AAC3C,2CAAwE;AACxE,iDAA6C;AAC7C,+DAAoE;AACpE,sCAAwC;AAE3B,QAAA,gBAAgB,GAAG,IAAA,+BAAY,EAAC;IAC3C,IAAI,EAAE,oBAAa;IACnB,IAAI,EAAE,aAAa;IACnB,WAAW,EAAE,aAAa;IAC1B,WAAW,EAAE,oCAAoC;IACjD,KAAK,EAAE;QACL,YAAY,EAAE,IAAA,wBAAgB,EAAC,aAAa,EAAE,IAAI,CAAC;QACnD,eAAe,EAAE,IAAA,2BAAmB,EAAC,WAAW,EAAE,IAAI,CAAC;QACvD,aAAa,EAAE,IAAA,wBAAgB,EAAC,cAAc,EAAE,IAAI,CAAC;KACtD;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,EAAE,YAAY,EAAE,eAAe,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAE5E,IAAI,IAAA,cAAK,EAAC,YAAY,CAAC,IAAI,IAAA,cAAK,EAAC,eAAe,CAAC,IAAI,IAAA,cAAK,EAAC,aAAa,CAAC,EAAE,CAAC;gBAC1E,MAAM,IAAI,KAAK,CAAC,uDAAuD,CAAC,CAAC;YAC3E,CAAC;YAED,MAAM,QAAQ,GAAG,MAAM,IAAA,oBAAW,EAAC;gBACjC,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,WAAW,EAAE,YAAY;gBACzB,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,IAAI,EAAE;oBACJ,IAAI,EAAE;wBACJ,EAAE,EAAE,eAAe;qBACpB;oBACD,WAAW,EAAE;wBACX,EAAE,EAAE,aAAa;qBAClB;oBACD,YAAY,EAAE;wBACZ,EAAE,EAAE,YAAY;qBACjB;iBACF;aACF,CAAC,CAAC;YAEH,OAAO;gBACL,OAAO,EAAE,IAAI;gBACb,OAAO,EAAE,4BAA4B;gBACrC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI;aACjC,CAAC;QACJ,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transition-issue.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/transition-issue.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqChC,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { TriggerStrategy } from '@activepieces/pieces-framework';
|
|
2
|
+
export declare const issueAssigned: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
3
|
+
instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
|
+
email: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
5
|
+
apiToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
6
|
+
}>, {
|
|
7
|
+
assignedToMe: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
8
|
+
assignee: import("@activepieces/pieces-framework").DropdownProperty<any, false, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
9
|
+
instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
10
|
+
email: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
11
|
+
apiToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
12
|
+
}>> | import("@activepieces/pieces-framework").DropdownProperty<any, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
13
|
+
instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
14
|
+
email: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
15
|
+
apiToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
16
|
+
}>>;
|
|
17
|
+
jql: import("@activepieces/pieces-framework").LongTextProperty<false>;
|
|
18
|
+
sanitizeJql: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
19
|
+
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, 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
|
+
assignedToMe: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
25
|
+
assignee: import("@activepieces/pieces-framework").DropdownProperty<any, false, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
26
|
+
instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
27
|
+
email: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
28
|
+
apiToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
29
|
+
}>> | import("@activepieces/pieces-framework").DropdownProperty<any, true, 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
|
+
jql: import("@activepieces/pieces-framework").LongTextProperty<false>;
|
|
35
|
+
sanitizeJql: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
36
|
+
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.MANUAL, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
37
|
+
instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
38
|
+
email: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
39
|
+
apiToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
40
|
+
}>, {
|
|
41
|
+
assignedToMe: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
42
|
+
assignee: import("@activepieces/pieces-framework").DropdownProperty<any, false, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
43
|
+
instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
44
|
+
email: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
45
|
+
apiToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
46
|
+
}>> | import("@activepieces/pieces-framework").DropdownProperty<any, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
47
|
+
instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
48
|
+
email: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
49
|
+
apiToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
50
|
+
}>>;
|
|
51
|
+
jql: import("@activepieces/pieces-framework").LongTextProperty<false>;
|
|
52
|
+
sanitizeJql: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
53
|
+
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
54
|
+
instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
55
|
+
email: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
56
|
+
apiToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
57
|
+
}>, {
|
|
58
|
+
assignedToMe: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
59
|
+
assignee: import("@activepieces/pieces-framework").DropdownProperty<any, false, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
60
|
+
instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
61
|
+
email: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
62
|
+
apiToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
63
|
+
}>> | import("@activepieces/pieces-framework").DropdownProperty<any, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
64
|
+
instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
65
|
+
email: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
66
|
+
apiToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
67
|
+
}>>;
|
|
68
|
+
jql: import("@activepieces/pieces-framework").LongTextProperty<false>;
|
|
69
|
+
sanitizeJql: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
70
|
+
}>;
|
|
71
|
+
//# sourceMappingURL=issue-assigned.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"issue-assigned.d.ts","sourceRoot":"","sources":["../../../../src/lib/triggers/issue-assigned.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,eAAe,EAEhB,MAAM,gCAAgC,CAAC;AAgHxC,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2OxB,CAAC"}
|
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.issueAssigned = 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 dayjs_1 = tslib_1.__importDefault(require("dayjs"));
|
|
8
|
+
const auth_1 = require("../../auth");
|
|
9
|
+
const common_1 = require("../common");
|
|
10
|
+
const props_1 = require("../common/props");
|
|
11
|
+
const polling = {
|
|
12
|
+
strategy: pieces_common_1.DedupeStrategy.TIMEBASED,
|
|
13
|
+
items: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth, lastFetchEpochMS, propsValue }) {
|
|
14
|
+
var _b, _c;
|
|
15
|
+
const { assignee, assignedToMe, jql, sanitizeJql } = propsValue;
|
|
16
|
+
const targetClause = assignedToMe
|
|
17
|
+
? 'TO currentUser()'
|
|
18
|
+
: assignee
|
|
19
|
+
? `TO "${assignee}"`
|
|
20
|
+
: '';
|
|
21
|
+
const since = (0, dayjs_1.default)(lastFetchEpochMS).format('YYYY-MM-DD HH:mm');
|
|
22
|
+
const userScope = jql ? `(${jql}) AND ` : '';
|
|
23
|
+
const searchQuery = `${userScope}assignee CHANGED ${targetClause} AFTER '${since}'`.trim();
|
|
24
|
+
const response = yield (0, common_1.searchIssuesByJql)({
|
|
25
|
+
auth,
|
|
26
|
+
jql: searchQuery,
|
|
27
|
+
maxResults: 50,
|
|
28
|
+
sanitizeJql: sanitizeJql !== null && sanitizeJql !== void 0 ? sanitizeJql : false,
|
|
29
|
+
expand: ['changelog'],
|
|
30
|
+
});
|
|
31
|
+
const issues = response.issues;
|
|
32
|
+
const targetAccountId = assignedToMe ? undefined : assignee;
|
|
33
|
+
const results = [];
|
|
34
|
+
for (const issue of issues) {
|
|
35
|
+
const histories = (_c = (_b = issue.changelog) === null || _b === void 0 ? void 0 : _b.histories) !== null && _c !== void 0 ? _c : [];
|
|
36
|
+
for (const history of histories) {
|
|
37
|
+
const changedMS = Date.parse(history.created);
|
|
38
|
+
if (Number.isNaN(changedMS) || changedMS <= lastFetchEpochMS)
|
|
39
|
+
continue;
|
|
40
|
+
const assigneeChange = history.items.find((item) => item.field === 'assignee' || item.fieldId === 'assignee');
|
|
41
|
+
if (!assigneeChange)
|
|
42
|
+
continue;
|
|
43
|
+
if (targetAccountId && assigneeChange.to !== targetAccountId)
|
|
44
|
+
continue;
|
|
45
|
+
results.push({
|
|
46
|
+
epochMilliSeconds: changedMS,
|
|
47
|
+
data: {
|
|
48
|
+
issue: {
|
|
49
|
+
id: issue.id,
|
|
50
|
+
key: issue.key,
|
|
51
|
+
fields: issue.fields,
|
|
52
|
+
},
|
|
53
|
+
change: {
|
|
54
|
+
from: {
|
|
55
|
+
accountId: assigneeChange.from,
|
|
56
|
+
displayName: assigneeChange.fromString,
|
|
57
|
+
},
|
|
58
|
+
to: {
|
|
59
|
+
accountId: assigneeChange.to,
|
|
60
|
+
displayName: assigneeChange.toString,
|
|
61
|
+
},
|
|
62
|
+
by: history.author,
|
|
63
|
+
at: history.created,
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return results;
|
|
70
|
+
}),
|
|
71
|
+
};
|
|
72
|
+
exports.issueAssigned = (0, pieces_framework_1.createTrigger)({
|
|
73
|
+
name: 'issue_assigned',
|
|
74
|
+
displayName: 'Issue Assigned',
|
|
75
|
+
description: 'Fires when a Jira issue is assigned to someone. Use it to ping people in Slack/Teams the moment work lands on them, auto-create a to-do when tickets hit your queue, or track hand-offs between teammates.',
|
|
76
|
+
auth: auth_1.jiraCloudAuth,
|
|
77
|
+
type: pieces_framework_1.TriggerStrategy.POLLING,
|
|
78
|
+
props: {
|
|
79
|
+
assignedToMe: pieces_framework_1.Property.Checkbox({
|
|
80
|
+
displayName: 'Only when assigned to me',
|
|
81
|
+
description: 'Only trigger when the issue is assigned to the user who set up this connection. Overrides the Assignee field below.',
|
|
82
|
+
required: false,
|
|
83
|
+
defaultValue: false,
|
|
84
|
+
}),
|
|
85
|
+
assignee: (0, props_1.getUsersDropdown)({
|
|
86
|
+
displayName: 'Assignee (optional)',
|
|
87
|
+
description: 'Pick a teammate to watch. Leave empty to trigger on assignments to anyone. Ignored if "Only when assigned to me" is checked.',
|
|
88
|
+
required: false,
|
|
89
|
+
}),
|
|
90
|
+
jql: pieces_framework_1.Property.LongText({
|
|
91
|
+
displayName: 'Only watch these issues (optional)',
|
|
92
|
+
description: `Narrow down which issues to watch. Leave empty to watch every issue in your Jira.
|
|
93
|
+
|
|
94
|
+
Ready-to-use examples:
|
|
95
|
+
|
|
96
|
+
- \`project = "SUPPORT"\` — only the Support project
|
|
97
|
+
- \`priority = High\` — only high-priority issues
|
|
98
|
+
- \`labels = "vip"\` — only issues tagged \`vip\`
|
|
99
|
+
- \`project = "SUPPORT" AND status != Done\` — combine with \`AND\`
|
|
100
|
+
|
|
101
|
+
Not sure what to write? Open Jira → Filters → Advanced search, build a filter visually, then copy the query here.`,
|
|
102
|
+
required: false,
|
|
103
|
+
}),
|
|
104
|
+
sanitizeJql: pieces_framework_1.Property.Checkbox({
|
|
105
|
+
displayName: 'Auto-fix the filter',
|
|
106
|
+
description: "Keep this on. If your filter references something you can't access (a private project, a deleted field), Jira will automatically clean it up instead of erroring.",
|
|
107
|
+
required: false,
|
|
108
|
+
defaultValue: true,
|
|
109
|
+
}),
|
|
110
|
+
},
|
|
111
|
+
sampleData: {
|
|
112
|
+
issue: {
|
|
113
|
+
id: '10001',
|
|
114
|
+
key: 'EXAMPLE-1',
|
|
115
|
+
fields: {
|
|
116
|
+
statuscategorychangedate: '2024-01-15T10:00:00.000+0000',
|
|
117
|
+
issuetype: {
|
|
118
|
+
self: 'https://example.atlassian.net/rest/api/3/issuetype/10003',
|
|
119
|
+
id: '10003',
|
|
120
|
+
description: 'Tasks track small, distinct pieces of work.',
|
|
121
|
+
iconUrl: 'https://example.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10318?size=medium',
|
|
122
|
+
name: 'Task',
|
|
123
|
+
subtask: false,
|
|
124
|
+
avatarId: 10318,
|
|
125
|
+
entityId: '00000000-0000-0000-0000-000000000000',
|
|
126
|
+
hierarchyLevel: 0,
|
|
127
|
+
},
|
|
128
|
+
components: [],
|
|
129
|
+
timespent: null,
|
|
130
|
+
timeoriginalestimate: null,
|
|
131
|
+
project: {
|
|
132
|
+
self: 'https://example.atlassian.net/rest/api/3/project/10000',
|
|
133
|
+
id: '10000',
|
|
134
|
+
key: 'EXAMPLE',
|
|
135
|
+
name: 'Example Project',
|
|
136
|
+
projectTypeKey: 'software',
|
|
137
|
+
simplified: true,
|
|
138
|
+
avatarUrls: {
|
|
139
|
+
'48x48': 'https://example.atlassian.net/rest/api/3/universal_avatar/view/type/project/avatar/10413',
|
|
140
|
+
'24x24': 'https://example.atlassian.net/rest/api/3/universal_avatar/view/type/project/avatar/10413?size=small',
|
|
141
|
+
'16x16': 'https://example.atlassian.net/rest/api/3/universal_avatar/view/type/project/avatar/10413?size=xsmall',
|
|
142
|
+
'32x32': 'https://example.atlassian.net/rest/api/3/universal_avatar/view/type/project/avatar/10413?size=medium',
|
|
143
|
+
},
|
|
144
|
+
},
|
|
145
|
+
description: null,
|
|
146
|
+
fixVersions: [],
|
|
147
|
+
aggregatetimespent: null,
|
|
148
|
+
statusCategory: {
|
|
149
|
+
self: 'https://example.atlassian.net/rest/api/3/statuscategory/2',
|
|
150
|
+
id: 2,
|
|
151
|
+
key: 'new',
|
|
152
|
+
colorName: 'blue-gray',
|
|
153
|
+
name: 'To Do',
|
|
154
|
+
},
|
|
155
|
+
resolution: null,
|
|
156
|
+
security: null,
|
|
157
|
+
aggregatetimeestimate: null,
|
|
158
|
+
resolutiondate: null,
|
|
159
|
+
workratio: -1,
|
|
160
|
+
summary: 'Example issue summary',
|
|
161
|
+
watches: {
|
|
162
|
+
self: 'https://example.atlassian.net/rest/api/3/issue/EXAMPLE-1/watchers',
|
|
163
|
+
watchCount: 1,
|
|
164
|
+
isWatching: true,
|
|
165
|
+
},
|
|
166
|
+
lastViewed: '2024-01-15T10:05:00.000+0000',
|
|
167
|
+
creator: {
|
|
168
|
+
self: 'https://example.atlassian.net/rest/api/3/user?accountId=111111%3A11111111-1111-1111-1111-111111111111',
|
|
169
|
+
accountId: '111111:11111111-1111-1111-1111-111111111111',
|
|
170
|
+
emailAddress: 'alice@example.com',
|
|
171
|
+
avatarUrls: {
|
|
172
|
+
'48x48': 'https://example.com/avatar/alice.png',
|
|
173
|
+
'24x24': 'https://example.com/avatar/alice.png',
|
|
174
|
+
'16x16': 'https://example.com/avatar/alice.png',
|
|
175
|
+
'32x32': 'https://example.com/avatar/alice.png',
|
|
176
|
+
},
|
|
177
|
+
displayName: 'Alice Example',
|
|
178
|
+
active: true,
|
|
179
|
+
timeZone: 'UTC',
|
|
180
|
+
accountType: 'atlassian',
|
|
181
|
+
},
|
|
182
|
+
subtasks: [],
|
|
183
|
+
created: '2024-01-15T09:00:00.000+0000',
|
|
184
|
+
reporter: {
|
|
185
|
+
self: 'https://example.atlassian.net/rest/api/3/user?accountId=111111%3A11111111-1111-1111-1111-111111111111',
|
|
186
|
+
accountId: '111111:11111111-1111-1111-1111-111111111111',
|
|
187
|
+
emailAddress: 'alice@example.com',
|
|
188
|
+
avatarUrls: {
|
|
189
|
+
'48x48': 'https://example.com/avatar/alice.png',
|
|
190
|
+
'24x24': 'https://example.com/avatar/alice.png',
|
|
191
|
+
'16x16': 'https://example.com/avatar/alice.png',
|
|
192
|
+
'32x32': 'https://example.com/avatar/alice.png',
|
|
193
|
+
},
|
|
194
|
+
displayName: 'Alice Example',
|
|
195
|
+
active: true,
|
|
196
|
+
timeZone: 'UTC',
|
|
197
|
+
accountType: 'atlassian',
|
|
198
|
+
},
|
|
199
|
+
aggregateprogress: {
|
|
200
|
+
progress: 0,
|
|
201
|
+
total: 0,
|
|
202
|
+
},
|
|
203
|
+
priority: {
|
|
204
|
+
self: 'https://example.atlassian.net/rest/api/3/priority/3',
|
|
205
|
+
iconUrl: 'https://example.atlassian.net/images/icons/priorities/medium_new.svg',
|
|
206
|
+
name: 'Medium',
|
|
207
|
+
id: '3',
|
|
208
|
+
},
|
|
209
|
+
labels: [],
|
|
210
|
+
environment: null,
|
|
211
|
+
timeestimate: null,
|
|
212
|
+
aggregatetimeoriginalestimate: null,
|
|
213
|
+
versions: [],
|
|
214
|
+
duedate: null,
|
|
215
|
+
progress: {
|
|
216
|
+
progress: 0,
|
|
217
|
+
total: 0,
|
|
218
|
+
},
|
|
219
|
+
issuelinks: [],
|
|
220
|
+
votes: {
|
|
221
|
+
self: 'https://example.atlassian.net/rest/api/3/issue/EXAMPLE-1/votes',
|
|
222
|
+
votes: 0,
|
|
223
|
+
hasVoted: false,
|
|
224
|
+
},
|
|
225
|
+
assignee: {
|
|
226
|
+
self: 'https://example.atlassian.net/rest/api/3/user?accountId=222222%3A22222222-2222-2222-2222-222222222222',
|
|
227
|
+
accountId: '222222:22222222-2222-2222-2222-222222222222',
|
|
228
|
+
emailAddress: 'bob@example.com',
|
|
229
|
+
avatarUrls: {
|
|
230
|
+
'48x48': 'https://example.com/avatar/bob.png',
|
|
231
|
+
'24x24': 'https://example.com/avatar/bob.png',
|
|
232
|
+
'16x16': 'https://example.com/avatar/bob.png',
|
|
233
|
+
'32x32': 'https://example.com/avatar/bob.png',
|
|
234
|
+
},
|
|
235
|
+
displayName: 'Bob Example',
|
|
236
|
+
active: true,
|
|
237
|
+
timeZone: 'UTC',
|
|
238
|
+
accountType: 'atlassian',
|
|
239
|
+
},
|
|
240
|
+
updated: '2024-01-15T10:00:00.000+0000',
|
|
241
|
+
status: {
|
|
242
|
+
self: 'https://example.atlassian.net/rest/api/3/status/10000',
|
|
243
|
+
description: '',
|
|
244
|
+
iconUrl: 'https://example.atlassian.net/images/icons/statuses/generic.png',
|
|
245
|
+
name: 'To Do',
|
|
246
|
+
id: '10000',
|
|
247
|
+
statusCategory: {
|
|
248
|
+
self: 'https://example.atlassian.net/rest/api/3/statuscategory/2',
|
|
249
|
+
id: 2,
|
|
250
|
+
key: 'new',
|
|
251
|
+
colorName: 'blue-gray',
|
|
252
|
+
name: 'To Do',
|
|
253
|
+
},
|
|
254
|
+
},
|
|
255
|
+
},
|
|
256
|
+
},
|
|
257
|
+
change: {
|
|
258
|
+
from: {
|
|
259
|
+
accountId: null,
|
|
260
|
+
displayName: null,
|
|
261
|
+
},
|
|
262
|
+
to: {
|
|
263
|
+
accountId: '222222:22222222-2222-2222-2222-222222222222',
|
|
264
|
+
displayName: 'Bob Example',
|
|
265
|
+
},
|
|
266
|
+
by: {
|
|
267
|
+
self: 'https://example.atlassian.net/rest/api/3/user?accountId=111111%3A11111111-1111-1111-1111-111111111111',
|
|
268
|
+
accountId: '111111:11111111-1111-1111-1111-111111111111',
|
|
269
|
+
emailAddress: 'alice@example.com',
|
|
270
|
+
avatarUrls: {
|
|
271
|
+
'48x48': 'https://example.com/avatar/alice.png',
|
|
272
|
+
'24x24': 'https://example.com/avatar/alice.png',
|
|
273
|
+
'16x16': 'https://example.com/avatar/alice.png',
|
|
274
|
+
'32x32': 'https://example.com/avatar/alice.png',
|
|
275
|
+
},
|
|
276
|
+
displayName: 'Alice Example',
|
|
277
|
+
active: true,
|
|
278
|
+
timeZone: 'UTC',
|
|
279
|
+
accountType: 'atlassian',
|
|
280
|
+
},
|
|
281
|
+
at: '2024-01-15T10:00:00.000+0000',
|
|
282
|
+
},
|
|
283
|
+
},
|
|
284
|
+
onEnable(context) {
|
|
285
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
286
|
+
yield pieces_common_1.pollingHelper.onEnable(polling, context);
|
|
287
|
+
});
|
|
288
|
+
},
|
|
289
|
+
onDisable(context) {
|
|
290
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
291
|
+
yield pieces_common_1.pollingHelper.onDisable(polling, context);
|
|
292
|
+
});
|
|
293
|
+
},
|
|
294
|
+
run(context) {
|
|
295
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
296
|
+
return yield pieces_common_1.pollingHelper.poll(polling, context);
|
|
297
|
+
});
|
|
298
|
+
},
|
|
299
|
+
test(context) {
|
|
300
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
301
|
+
return yield pieces_common_1.pollingHelper.test(polling, context);
|
|
302
|
+
});
|
|
303
|
+
},
|
|
304
|
+
});
|
|
305
|
+
//# sourceMappingURL=issue-assigned.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"issue-assigned.js","sourceRoot":"","sources":["../../../../src/lib/triggers/issue-assigned.ts"],"names":[],"mappings":";;;;AAAA,qEAIwC;AACxC,+DAIqC;AACrC,0DAA0B;AAC1B,qCAAqD;AACrD,sCAA8C;AAC9C,2CAAmD;AAyBnD,MAAM,OAAO,GAQT;IACF,QAAQ,EAAE,8BAAc,CAAC,SAAS;IAClC,KAAK,EAAE,KAA+C,EAAE,oDAA1C,EAAE,IAAI,EAAE,gBAAgB,EAAE,UAAU,EAAE;;QAClD,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAG,EAAE,WAAW,EAAE,GAAG,UAAU,CAAC;QAEhE,MAAM,YAAY,GAAG,YAAY;YAC/B,CAAC,CAAC,kBAAkB;YACpB,CAAC,CAAC,QAAQ;gBACV,CAAC,CAAC,OAAO,QAAQ,GAAG;gBACpB,CAAC,CAAC,EAAE,CAAC;QAEP,MAAM,KAAK,GAAG,IAAA,eAAK,EAAC,gBAAgB,CAAC,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC;QACjE,MAAM,SAAS,GAAG,GAAG,CAAC,CAAC,CAAC,IAAI,GAAG,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;QAC7C,MAAM,WAAW,GACf,GAAG,SAAS,oBAAoB,YAAY,WAAW,KAAK,GAAG,CAAC,IAAI,EAAE,CAAC;QAEzE,MAAM,QAAQ,GAAG,MAAM,IAAA,0BAAiB,EAAC;YACvC,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,KAAK;gBACf,WAAW,EAAE,WAAW;aACzB;YACD,EAAE,EAAE,8BAA8B;SACnC;KACF;IACK,QAAQ,CAAC,OAAO;;YACpB,MAAM,6BAAa,CAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACjD,CAAC;KAAA;IACK,SAAS,CAAC,OAAO;;YACrB,MAAM,6BAAa,CAAC,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAClD,CAAC;KAAA;IACK,GAAG,CAAC,OAAO;;YACf,OAAO,MAAM,6BAAa,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACpD,CAAC;KAAA;IACK,IAAI,CAAC,OAAO;;YAChB,OAAO,MAAM,6BAAa,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACpD,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { TriggerStrategy } from '@activepieces/pieces-framework';
|
|
2
|
+
export declare const newAttachment: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
3
|
+
instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
|
+
email: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
5
|
+
apiToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
6
|
+
}>, {
|
|
7
|
+
jql: import("@activepieces/pieces-framework").LongTextProperty<false>;
|
|
8
|
+
sanitizeJql: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
9
|
+
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
10
|
+
instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
11
|
+
email: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
12
|
+
apiToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
13
|
+
}>, {
|
|
14
|
+
jql: import("@activepieces/pieces-framework").LongTextProperty<false>;
|
|
15
|
+
sanitizeJql: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
16
|
+
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.MANUAL, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
17
|
+
instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
18
|
+
email: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
19
|
+
apiToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
20
|
+
}>, {
|
|
21
|
+
jql: import("@activepieces/pieces-framework").LongTextProperty<false>;
|
|
22
|
+
sanitizeJql: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
23
|
+
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
24
|
+
instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
25
|
+
email: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
26
|
+
apiToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
27
|
+
}>, {
|
|
28
|
+
jql: import("@activepieces/pieces-framework").LongTextProperty<false>;
|
|
29
|
+
sanitizeJql: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
30
|
+
}>;
|
|
31
|
+
//# sourceMappingURL=new-attachment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"new-attachment.d.ts","sourceRoot":"","sources":["../../../../src/lib/triggers/new-attachment.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,eAAe,EAEhB,MAAM,gCAAgC,CAAC;AAiHxC,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkGxB,CAAC"}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.newAttachment = 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 dayjs_1 = tslib_1.__importDefault(require("dayjs"));
|
|
8
|
+
const auth_1 = require("../../auth");
|
|
9
|
+
const common_1 = require("../common");
|
|
10
|
+
const polling = {
|
|
11
|
+
strategy: pieces_common_1.DedupeStrategy.TIMEBASED,
|
|
12
|
+
items: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth, lastFetchEpochMS, propsValue }) {
|
|
13
|
+
var _b, _c, _d;
|
|
14
|
+
const { jql, sanitizeJql } = propsValue;
|
|
15
|
+
const since = (0, dayjs_1.default)(lastFetchEpochMS).format('YYYY-MM-DD HH:mm');
|
|
16
|
+
const userScope = jql ? `(${jql}) AND ` : '';
|
|
17
|
+
const searchQuery = `${userScope}updated > '${since}'`;
|
|
18
|
+
const response = yield (0, common_1.searchIssuesByJql)({
|
|
19
|
+
auth,
|
|
20
|
+
jql: searchQuery,
|
|
21
|
+
maxResults: 50,
|
|
22
|
+
sanitizeJql: sanitizeJql !== null && sanitizeJql !== void 0 ? sanitizeJql : false,
|
|
23
|
+
fields: ['summary', 'attachment'],
|
|
24
|
+
expand: ['changelog'],
|
|
25
|
+
});
|
|
26
|
+
const issues = response.issues;
|
|
27
|
+
const results = [];
|
|
28
|
+
for (const issue of issues) {
|
|
29
|
+
const attachmentsById = new Map();
|
|
30
|
+
for (const attachment of (_b = issue.fields.attachment) !== null && _b !== void 0 ? _b : []) {
|
|
31
|
+
attachmentsById.set(attachment.id, attachment);
|
|
32
|
+
}
|
|
33
|
+
const histories = (_d = (_c = issue.changelog) === null || _c === void 0 ? void 0 : _c.histories) !== null && _d !== void 0 ? _d : [];
|
|
34
|
+
for (const history of histories) {
|
|
35
|
+
const changedMS = Date.parse(history.created);
|
|
36
|
+
if (Number.isNaN(changedMS) || changedMS <= lastFetchEpochMS)
|
|
37
|
+
continue;
|
|
38
|
+
for (const item of history.items) {
|
|
39
|
+
const isAttachment = item.field === 'Attachment' || item.fieldId === 'attachment';
|
|
40
|
+
const wasAdded = item.to !== null && item.to !== undefined;
|
|
41
|
+
if (!isAttachment || !wasAdded)
|
|
42
|
+
continue;
|
|
43
|
+
const attachmentDetails = item.to
|
|
44
|
+
? attachmentsById.get(item.to)
|
|
45
|
+
: undefined;
|
|
46
|
+
results.push({
|
|
47
|
+
epochMilliSeconds: changedMS,
|
|
48
|
+
data: {
|
|
49
|
+
issue: {
|
|
50
|
+
id: issue.id,
|
|
51
|
+
key: issue.key,
|
|
52
|
+
summary: issue.fields.summary,
|
|
53
|
+
},
|
|
54
|
+
attachment: attachmentDetails !== null && attachmentDetails !== void 0 ? attachmentDetails : {
|
|
55
|
+
id: item.to,
|
|
56
|
+
filename: item.toString,
|
|
57
|
+
},
|
|
58
|
+
addedBy: history.author,
|
|
59
|
+
addedAt: history.created,
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return results;
|
|
66
|
+
}),
|
|
67
|
+
};
|
|
68
|
+
exports.newAttachment = (0, pieces_framework_1.createTrigger)({
|
|
69
|
+
name: 'new_attachment',
|
|
70
|
+
displayName: 'New Attachment on Issue',
|
|
71
|
+
description: 'Fires when a file is attached to a Jira issue. Great for auto-saving screenshots to Google Drive, forwarding customer uploads to support tools, or archiving documents in S3.',
|
|
72
|
+
auth: auth_1.jiraCloudAuth,
|
|
73
|
+
type: pieces_framework_1.TriggerStrategy.POLLING,
|
|
74
|
+
props: {
|
|
75
|
+
jql: pieces_framework_1.Property.LongText({
|
|
76
|
+
displayName: 'Only watch these issues (optional)',
|
|
77
|
+
description: `Narrow down which issues to watch. Leave empty to watch every issue in your Jira.
|
|
78
|
+
|
|
79
|
+
Ready-to-use examples:
|
|
80
|
+
|
|
81
|
+
- \`project = "SUPPORT"\` — only the Support project
|
|
82
|
+
- \`issuetype = Bug\` — only bugs
|
|
83
|
+
- \`labels = "screenshot-needed"\` — only issues tagged \`screenshot-needed\`
|
|
84
|
+
- \`project = "SUPPORT" AND status != Done\` — combine with \`AND\`
|
|
85
|
+
|
|
86
|
+
Not sure what to write? Open Jira → Filters → Advanced search, build a filter visually, then copy the query here.`,
|
|
87
|
+
required: false,
|
|
88
|
+
}),
|
|
89
|
+
sanitizeJql: pieces_framework_1.Property.Checkbox({
|
|
90
|
+
displayName: 'Auto-fix the filter',
|
|
91
|
+
description: "Keep this on. If your filter references something you can't access (a private project, a deleted field), Jira will automatically clean it up instead of erroring.",
|
|
92
|
+
required: false,
|
|
93
|
+
defaultValue: true,
|
|
94
|
+
}),
|
|
95
|
+
},
|
|
96
|
+
sampleData: {
|
|
97
|
+
issue: {
|
|
98
|
+
id: '10001',
|
|
99
|
+
key: 'KAN-2',
|
|
100
|
+
summary: 'dss',
|
|
101
|
+
},
|
|
102
|
+
attachment: {
|
|
103
|
+
self: 'https://Jonsworkspace-353579.atlassian.net/rest/api/3/attachment/10000',
|
|
104
|
+
id: '10000',
|
|
105
|
+
filename: 'image_stamped_basic-link-1 (1).pdf',
|
|
106
|
+
author: {
|
|
107
|
+
self: 'https://Jonsworkspace-544.atlassian.net/rest/api/3/user?accountId=dddd%3A17dca26e-0509-41b7-9bfe-d5f6b9bfa943',
|
|
108
|
+
accountId: '712020:17dca26e-0509-41b7-9bfe-d5f6b9bfa943',
|
|
109
|
+
emailAddress: 'Jonde57@gmail.com',
|
|
110
|
+
avatarUrls: {
|
|
111
|
+
'48x48': 'https://secure.gravatar.com/avatar/sssss?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FSN-2.png',
|
|
112
|
+
'24x24': 'https://secure.gravatar.com/avatar/s?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FSN-2.png',
|
|
113
|
+
'16x16': 'https://secure.gravatar.com/avatar/shouldComponentUpdate(nextProps, nextState) { first }?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FSN-2.png',
|
|
114
|
+
'32x32': 'https://secure.gravatar.com/avatar/s?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FSN-2.png',
|
|
115
|
+
},
|
|
116
|
+
displayName: 'Jon de',
|
|
117
|
+
active: true,
|
|
118
|
+
timeZone: 'Asia/Kolkata',
|
|
119
|
+
accountType: 'atlassian',
|
|
120
|
+
},
|
|
121
|
+
created: '2026-04-23T14:31:38.070+0530',
|
|
122
|
+
size: 116999,
|
|
123
|
+
mimeType: 'application/pdf',
|
|
124
|
+
content: 'https://Jonsworkspace-s.atlassian.net/rest/api/3/attachment/content/10000',
|
|
125
|
+
},
|
|
126
|
+
addedBy: {
|
|
127
|
+
self: 'https://Jonsworkspace-556.atlassian.net/rest/api/3/user?accountId=712020%3A17dca26e-0509-41b7-9bfe-d5f6b9bfa943',
|
|
128
|
+
accountId: '712020:17dca26e-0509-41b7-9bfe-d5f6b9bfa943',
|
|
129
|
+
emailAddress: 'Jonde57@gmail.com',
|
|
130
|
+
avatarUrls: {
|
|
131
|
+
'48x48': 'https://secure.gravatar.com/avatar/fdsdssd?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FSN-2.png',
|
|
132
|
+
'24x24': 'https://secure.gravatar.com/avatar/fdsdssd?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FSN-2.png',
|
|
133
|
+
'16x16': 'https://secure.gravatar.com/avatar/fdsdssd?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FSN-2.png',
|
|
134
|
+
'32x32': 'https://secure.gravatar.com/avatar/fdsdssd?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FSN-2.png',
|
|
135
|
+
},
|
|
136
|
+
displayName: 'Jon de',
|
|
137
|
+
active: true,
|
|
138
|
+
timeZone: 'Asia/Kolkata',
|
|
139
|
+
accountType: 'atlassian',
|
|
140
|
+
},
|
|
141
|
+
addedAt: '2026-04-23T14:31:39.121+0530',
|
|
142
|
+
},
|
|
143
|
+
onEnable(context) {
|
|
144
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
145
|
+
yield pieces_common_1.pollingHelper.onEnable(polling, context);
|
|
146
|
+
});
|
|
147
|
+
},
|
|
148
|
+
onDisable(context) {
|
|
149
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
150
|
+
yield pieces_common_1.pollingHelper.onDisable(polling, context);
|
|
151
|
+
});
|
|
152
|
+
},
|
|
153
|
+
run(context) {
|
|
154
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
155
|
+
return yield pieces_common_1.pollingHelper.poll(polling, context);
|
|
156
|
+
});
|
|
157
|
+
},
|
|
158
|
+
test(context) {
|
|
159
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
160
|
+
return yield pieces_common_1.pollingHelper.test(polling, context);
|
|
161
|
+
});
|
|
162
|
+
},
|
|
163
|
+
});
|
|
164
|
+
//# sourceMappingURL=new-attachment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"new-attachment.js","sourceRoot":"","sources":["../../../../src/lib/triggers/new-attachment.ts"],"names":[],"mappings":";;;;AAAA,qEAIwC;AACxC,+DAIqC;AACrC,0DAA0B;AAC1B,qCAAqD;AACrD,sCAA8C;AAuC9C,MAAM,OAAO,GAA+D;IAC1E,QAAQ,EAAE,8BAAc,CAAC,SAAS;IAClC,KAAK,EAAE,KAA+C,EAAE,oDAA1C,EAAE,IAAI,EAAE,gBAAgB,EAAE,UAAU,EAAE;;QAClD,MAAM,EAAE,GAAG,EAAE,WAAW,EAAE,GAAG,UAAU,CAAC;QAExC,MAAM,K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EAAE,WAAW;SACzB;QACD,OAAO,EAAE,8BAA8B;KACxC;IACK,QAAQ,CAAC,OAAO;;YACpB,MAAM,6BAAa,CAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACjD,CAAC;KAAA;IACK,SAAS,CAAC,OAAO;;YACrB,MAAM,6BAAa,CAAC,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAClD,CAAC;KAAA;IACK,GAAG,CAAC,OAAO;;YACf,OAAO,MAAM,6BAAa,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACpD,CAAC;KAAA;IACK,IAAI,CAAC,OAAO;;YAChB,OAAO,MAAM,6BAAa,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACpD,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { TriggerStrategy } from '@activepieces/pieces-framework';
|
|
2
|
+
export declare const newComment: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
3
|
+
instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
|
+
email: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
5
|
+
apiToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
6
|
+
}>, {
|
|
7
|
+
jql: import("@activepieces/pieces-framework").LongTextProperty<false>;
|
|
8
|
+
sanitizeJql: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
9
|
+
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
10
|
+
instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
11
|
+
email: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
12
|
+
apiToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
13
|
+
}>, {
|
|
14
|
+
jql: import("@activepieces/pieces-framework").LongTextProperty<false>;
|
|
15
|
+
sanitizeJql: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
16
|
+
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.MANUAL, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
17
|
+
instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
18
|
+
email: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
19
|
+
apiToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
20
|
+
}>, {
|
|
21
|
+
jql: import("@activepieces/pieces-framework").LongTextProperty<false>;
|
|
22
|
+
sanitizeJql: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
23
|
+
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
24
|
+
instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
25
|
+
email: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
26
|
+
apiToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
27
|
+
}>, {
|
|
28
|
+
jql: import("@activepieces/pieces-framework").LongTextProperty<false>;
|
|
29
|
+
sanitizeJql: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
30
|
+
}>;
|
|
31
|
+
//# sourceMappingURL=new-comment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"new-comment.d.ts","sourceRoot":"","sources":["../../../../src/lib/triggers/new-comment.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,eAAe,EAEf,MAAM,gCAAgC,CAAC;AA6ExC,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4CrB,CAAC"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.newComment = 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 dayjs_1 = tslib_1.__importDefault(require("dayjs"));
|
|
8
|
+
const auth_1 = require("../../auth");
|
|
9
|
+
const common_1 = require("../common");
|
|
10
|
+
const polling = {
|
|
11
|
+
strategy: pieces_common_1.DedupeStrategy.TIMEBASED,
|
|
12
|
+
items: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth, lastFetchEpochMS, propsValue }) {
|
|
13
|
+
var _b, _c, _d, _e;
|
|
14
|
+
const { jql, sanitizeJql } = propsValue;
|
|
15
|
+
const searchQuery = `${jql ? jql + ' AND ' : ''}updated > '${(0, dayjs_1.default)(lastFetchEpochMS).format('YYYY-MM-DD HH:mm')}'`;
|
|
16
|
+
const searchResponse = yield (0, common_1.searchIssuesByJql)({
|
|
17
|
+
auth,
|
|
18
|
+
jql: searchQuery,
|
|
19
|
+
maxResults: 50,
|
|
20
|
+
sanitizeJql: sanitizeJql !== null && sanitizeJql !== void 0 ? sanitizeJql : false,
|
|
21
|
+
fields: ['summary', 'comment'],
|
|
22
|
+
});
|
|
23
|
+
const issues = searchResponse.issues;
|
|
24
|
+
const results = [];
|
|
25
|
+
for (const issue of issues) {
|
|
26
|
+
const comments = (_d = (_c = (_b = issue.fields) === null || _b === void 0 ? void 0 : _b.comment) === null || _c === void 0 ? void 0 : _c.comments) !== null && _d !== void 0 ? _d : [];
|
|
27
|
+
for (const comment of comments) {
|
|
28
|
+
const createdMS = Date.parse(comment.created);
|
|
29
|
+
if (Number.isNaN(createdMS) || createdMS <= lastFetchEpochMS)
|
|
30
|
+
continue;
|
|
31
|
+
results.push({
|
|
32
|
+
epochMilliSeconds: createdMS,
|
|
33
|
+
data: {
|
|
34
|
+
issue: {
|
|
35
|
+
id: issue.id,
|
|
36
|
+
key: issue.key,
|
|
37
|
+
summary: (_e = issue.fields) === null || _e === void 0 ? void 0 : _e.summary,
|
|
38
|
+
},
|
|
39
|
+
comment,
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return results;
|
|
45
|
+
}),
|
|
46
|
+
};
|
|
47
|
+
exports.newComment = (0, pieces_framework_1.createTrigger)({
|
|
48
|
+
name: 'new_comment',
|
|
49
|
+
displayName: 'New Comment',
|
|
50
|
+
description: 'Fires whenever someone adds a new comment to a Jira issue. Great for getting notified in Slack or Teams, syncing customer replies, or reacting to feedback automatically.',
|
|
51
|
+
auth: auth_1.jiraCloudAuth,
|
|
52
|
+
type: pieces_framework_1.TriggerStrategy.POLLING,
|
|
53
|
+
props: {
|
|
54
|
+
jql: pieces_framework_1.Property.LongText({
|
|
55
|
+
displayName: 'Only watch these issues (optional)',
|
|
56
|
+
description: `Leave empty to watch comments on **every** issue in your Jira.
|
|
57
|
+
|
|
58
|
+
To narrow it down, paste a Jira filter here. A few ready-to-use examples:
|
|
59
|
+
|
|
60
|
+
- \`project = "SUPPORT"\` — only issues in the Support project
|
|
61
|
+
- \`assignee = currentUser()\` — only issues assigned to you
|
|
62
|
+
- \`status != Done\` — skip closed issues
|
|
63
|
+
- \`labels = "vip"\` — only issues tagged \`vip\`
|
|
64
|
+
- \`project = "SUPPORT" AND priority = High\` — combine conditions with \`AND\`
|
|
65
|
+
|
|
66
|
+
Not sure what to write? Open Jira → Filters → Advanced search, build the filter visually, then copy the query here.`,
|
|
67
|
+
required: false,
|
|
68
|
+
}),
|
|
69
|
+
sanitizeJql: pieces_framework_1.Property.Checkbox({
|
|
70
|
+
displayName: 'Auto-fix the filter',
|
|
71
|
+
description: 'Keep this on. If your filter references something you can\'t access (a private project, a deleted field), Jira will automatically clean it up instead of erroring.',
|
|
72
|
+
required: false,
|
|
73
|
+
defaultValue: true,
|
|
74
|
+
}),
|
|
75
|
+
},
|
|
76
|
+
sampleData: {},
|
|
77
|
+
onEnable(context) {
|
|
78
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
79
|
+
yield pieces_common_1.pollingHelper.onEnable(polling, context);
|
|
80
|
+
});
|
|
81
|
+
},
|
|
82
|
+
onDisable(context) {
|
|
83
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
84
|
+
yield pieces_common_1.pollingHelper.onDisable(polling, context);
|
|
85
|
+
});
|
|
86
|
+
},
|
|
87
|
+
run(context) {
|
|
88
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
89
|
+
return yield pieces_common_1.pollingHelper.poll(polling, context);
|
|
90
|
+
});
|
|
91
|
+
},
|
|
92
|
+
test(context) {
|
|
93
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
94
|
+
return yield pieces_common_1.pollingHelper.test(polling, context);
|
|
95
|
+
});
|
|
96
|
+
},
|
|
97
|
+
});
|
|
98
|
+
//# sourceMappingURL=new-comment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"new-comment.js","sourceRoot":"","sources":["../../../../src/lib/triggers/new-comment.ts"],"names":[],"mappings":";;;;AAAA,qEAIwC;AACxC,+DAIqC;AACrC,0DAA0B;AAC1B,qCAAqD;AACrD,sCAA8C;AA0B9C,MAAM,OAAO,GAA+D;IAC3E,QAAQ,EAAE,8BAAc,CAAC,SAAS;IAClC,KAAK,EAAE,KAA+C,EAAE,oDAA1C,EAAE,IAAI,EAAE,gBAAgB,EAAE,UAAU,EAAE;;QACnD,MAAM,EAAE,GAAG,EAAE,WAAW,EAAE,GAAG,UAAU,CAAC;QAExC,MAAM,WAAW,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,OAAO,CAAC,CAAC,CAAC,EAAE,cAAc,IAAA,eAAK,EACjE,gBAAgB,CAChB,CAAC,MAAM,CAAC,kBAAkB,CAAC,GAAG,CAAC;QAEhC,MAAM,cAAc,GAAG,MAAM,IAAA,0BAAiB,EAAC;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