@activepieces/piece-jira-cloud 0.3.6 → 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.
Files changed (109) hide show
  1. package/package.json +7 -18
  2. package/src/index.js +109 -71
  3. package/src/auth.d.ts +0 -8
  4. package/src/auth.d.ts.map +0 -1
  5. package/src/auth.js +0 -62
  6. package/src/auth.js.map +0 -1
  7. package/src/index.d.ts +0 -6
  8. package/src/index.d.ts.map +0 -1
  9. package/src/index.js.map +0 -1
  10. package/src/lib/actions/add-attachment-to-issue.d.ts +0 -26
  11. package/src/lib/actions/add-attachment-to-issue.d.ts.map +0 -1
  12. package/src/lib/actions/add-attachment-to-issue.js +0 -46
  13. package/src/lib/actions/add-attachment-to-issue.js.map +0 -1
  14. package/src/lib/actions/add-comment-to-issue.d.ts +0 -27
  15. package/src/lib/actions/add-comment-to-issue.d.ts.map +0 -1
  16. package/src/lib/actions/add-comment-to-issue.js +0 -70
  17. package/src/lib/actions/add-comment-to-issue.js.map +0 -1
  18. package/src/lib/actions/add-watcher-to-issue.d.ts +0 -25
  19. package/src/lib/actions/add-watcher-to-issue.d.ts.map +0 -1
  20. package/src/lib/actions/add-watcher-to-issue.js +0 -53
  21. package/src/lib/actions/add-watcher-to-issue.js.map +0 -1
  22. package/src/lib/actions/assign-issue.d.ts +0 -34
  23. package/src/lib/actions/assign-issue.d.ts.map +0 -1
  24. package/src/lib/actions/assign-issue.js +0 -44
  25. package/src/lib/actions/assign-issue.js.map +0 -1
  26. package/src/lib/actions/create-issue.d.ts +0 -35
  27. package/src/lib/actions/create-issue.d.ts.map +0 -1
  28. package/src/lib/actions/create-issue.js +0 -137
  29. package/src/lib/actions/create-issue.js.map +0 -1
  30. package/src/lib/actions/delete-issue-comment.d.ts +0 -30
  31. package/src/lib/actions/delete-issue-comment.d.ts.map +0 -1
  32. package/src/lib/actions/delete-issue-comment.js +0 -69
  33. package/src/lib/actions/delete-issue-comment.js.map +0 -1
  34. package/src/lib/actions/find-user.d.ts +0 -8
  35. package/src/lib/actions/find-user.d.ts.map +0 -1
  36. package/src/lib/actions/find-user.js +0 -42
  37. package/src/lib/actions/find-user.js.map +0 -1
  38. package/src/lib/actions/get-issue-attachment.d.ts +0 -8
  39. package/src/lib/actions/get-issue-attachment.d.ts.map +0 -1
  40. package/src/lib/actions/get-issue-attachment.js +0 -53
  41. package/src/lib/actions/get-issue-attachment.js.map +0 -1
  42. package/src/lib/actions/get-issue.d.ts +0 -28
  43. package/src/lib/actions/get-issue.d.ts.map +0 -1
  44. package/src/lib/actions/get-issue.js +0 -128
  45. package/src/lib/actions/get-issue.js.map +0 -1
  46. package/src/lib/actions/link-issues.d.ts +0 -34
  47. package/src/lib/actions/link-issues.d.ts.map +0 -1
  48. package/src/lib/actions/link-issues.js +0 -56
  49. package/src/lib/actions/link-issues.js.map +0 -1
  50. package/src/lib/actions/list-issue-comments.d.ts +0 -27
  51. package/src/lib/actions/list-issue-comments.d.ts.map +0 -1
  52. package/src/lib/actions/list-issue-comments.js +0 -65
  53. package/src/lib/actions/list-issue-comments.js.map +0 -1
  54. package/src/lib/actions/markdown-to-jira-format.d.ts +0 -4
  55. package/src/lib/actions/markdown-to-jira-format.d.ts.map +0 -1
  56. package/src/lib/actions/markdown-to-jira-format.js +0 -42
  57. package/src/lib/actions/markdown-to-jira-format.js.map +0 -1
  58. package/src/lib/actions/search-issues.d.ts +0 -13
  59. package/src/lib/actions/search-issues.d.ts.map +0 -1
  60. package/src/lib/actions/search-issues.js +0 -97
  61. package/src/lib/actions/search-issues.js.map +0 -1
  62. package/src/lib/actions/transition-issue.d.ts +0 -34
  63. package/src/lib/actions/transition-issue.d.ts.map +0 -1
  64. package/src/lib/actions/transition-issue.js +0 -50
  65. package/src/lib/actions/transition-issue.js.map +0 -1
  66. package/src/lib/actions/update-issue-comment.d.ts +0 -32
  67. package/src/lib/actions/update-issue-comment.d.ts.map +0 -1
  68. package/src/lib/actions/update-issue-comment.js +0 -103
  69. package/src/lib/actions/update-issue-comment.js.map +0 -1
  70. package/src/lib/actions/update-issue.d.ts +0 -35
  71. package/src/lib/actions/update-issue.d.ts.map +0 -1
  72. package/src/lib/actions/update-issue.js +0 -161
  73. package/src/lib/actions/update-issue.js.map +0 -1
  74. package/src/lib/common/index.d.ts +0 -86
  75. package/src/lib/common/index.d.ts.map +0 -1
  76. package/src/lib/common/index.js +0 -288
  77. package/src/lib/common/index.js.map +0 -1
  78. package/src/lib/common/props.d.ts +0 -96
  79. package/src/lib/common/props.d.ts.map +0 -1
  80. package/src/lib/common/props.js +0 -591
  81. package/src/lib/common/props.js.map +0 -1
  82. package/src/lib/common/types.d.ts +0 -28
  83. package/src/lib/common/types.d.ts.map +0 -1
  84. package/src/lib/common/types.js +0 -26
  85. package/src/lib/common/types.js.map +0 -1
  86. package/src/lib/triggers/issue-assigned.d.ts +0 -71
  87. package/src/lib/triggers/issue-assigned.d.ts.map +0 -1
  88. package/src/lib/triggers/issue-assigned.js +0 -308
  89. package/src/lib/triggers/issue-assigned.js.map +0 -1
  90. package/src/lib/triggers/new-attachment.d.ts +0 -31
  91. package/src/lib/triggers/new-attachment.d.ts.map +0 -1
  92. package/src/lib/triggers/new-attachment.js +0 -167
  93. package/src/lib/triggers/new-attachment.js.map +0 -1
  94. package/src/lib/triggers/new-comment.d.ts +0 -31
  95. package/src/lib/triggers/new-comment.d.ts.map +0 -1
  96. package/src/lib/triggers/new-comment.js +0 -101
  97. package/src/lib/triggers/new-comment.js.map +0 -1
  98. package/src/lib/triggers/new-issue.d.ts +0 -31
  99. package/src/lib/triggers/new-issue.d.ts.map +0 -1
  100. package/src/lib/triggers/new-issue.js +0 -70
  101. package/src/lib/triggers/new-issue.js.map +0 -1
  102. package/src/lib/triggers/updated-issue-status.d.ts +0 -31
  103. package/src/lib/triggers/updated-issue-status.d.ts.map +0 -1
  104. package/src/lib/triggers/updated-issue-status.js +0 -70
  105. package/src/lib/triggers/updated-issue-status.js.map +0 -1
  106. package/src/lib/triggers/updated-issue.d.ts +0 -31
  107. package/src/lib/triggers/updated-issue.d.ts.map +0 -1
  108. package/src/lib/triggers/updated-issue.js +0 -70
  109. package/src/lib/triggers/updated-issue.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/lib/common/types.ts"],"names":[],"mappings":";;;AAyBa,QAAA,wBAAwB,GAAG;IACvC,YAAY;IACZ,cAAc;IACd,iBAAiB;IACjB,cAAc;IACd,SAAS;IACT,kBAAkB;IAClB,aAAa;IACb,iBAAiB;IACjB,aAAa;IACb,YAAY;IACZ,UAAU;IACV,QAAQ;IACR,OAAO;IACP,UAAU;IACV,cAAc;IACd,QAAQ;IACR,WAAW;IACX,KAAK;IACL,SAAS;IACT,QAAQ;CACR,CAAC"}
@@ -1,71 +0,0 @@
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
@@ -1 +0,0 @@
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+OxB,CAAC"}
@@ -1,308 +0,0 @@
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
- aiMetadata: {
77
- description: 'Fires when the assignee of a Jira issue changes, optionally filtered to a specific assignee, the connected user, or a JQL scope. Each event represents one assignment change and includes the issue plus the previous/new assignee, who made the change, and when. Polling-based; events arrive on the next poll, not instantly.',
78
- },
79
- auth: auth_1.jiraCloudAuth,
80
- type: pieces_framework_1.TriggerStrategy.POLLING,
81
- props: {
82
- assignedToMe: pieces_framework_1.Property.Checkbox({
83
- displayName: 'Only when assigned to me',
84
- description: 'Only trigger when the issue is assigned to the user who set up this connection. Overrides the Assignee field below.',
85
- required: false,
86
- defaultValue: false,
87
- }),
88
- assignee: (0, props_1.getUsersDropdown)({
89
- displayName: 'Assignee (optional)',
90
- description: 'Pick a teammate to watch. Leave empty to trigger on assignments to anyone. Ignored if "Only when assigned to me" is checked.',
91
- required: false,
92
- }),
93
- jql: pieces_framework_1.Property.LongText({
94
- displayName: 'Only watch these issues (optional)',
95
- description: `Narrow down which issues to watch. Leave empty to watch every issue in your Jira.
96
-
97
- Ready-to-use examples:
98
-
99
- - \`project = "SUPPORT"\` — only the Support project
100
- - \`priority = High\` — only high-priority issues
101
- - \`labels = "vip"\` — only issues tagged \`vip\`
102
- - \`project = "SUPPORT" AND status != Done\` — combine with \`AND\`
103
-
104
- Not sure what to write? Open Jira → Filters → Advanced search, build a filter visually, then copy the query here.`,
105
- required: false,
106
- }),
107
- sanitizeJql: pieces_framework_1.Property.Checkbox({
108
- displayName: 'Auto-fix the filter',
109
- 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.",
110
- required: false,
111
- defaultValue: true,
112
- }),
113
- },
114
- sampleData: {
115
- issue: {
116
- id: '10001',
117
- key: 'EXAMPLE-1',
118
- fields: {
119
- statuscategorychangedate: '2024-01-15T10:00:00.000+0000',
120
- issuetype: {
121
- self: 'https://example.atlassian.net/rest/api/3/issuetype/10003',
122
- id: '10003',
123
- description: 'Tasks track small, distinct pieces of work.',
124
- iconUrl: 'https://example.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10318?size=medium',
125
- name: 'Task',
126
- subtask: false,
127
- avatarId: 10318,
128
- entityId: '00000000-0000-0000-0000-000000000000',
129
- hierarchyLevel: 0,
130
- },
131
- components: [],
132
- timespent: null,
133
- timeoriginalestimate: null,
134
- project: {
135
- self: 'https://example.atlassian.net/rest/api/3/project/10000',
136
- id: '10000',
137
- key: 'EXAMPLE',
138
- name: 'Example Project',
139
- projectTypeKey: 'software',
140
- simplified: true,
141
- avatarUrls: {
142
- '48x48': 'https://example.atlassian.net/rest/api/3/universal_avatar/view/type/project/avatar/10413',
143
- '24x24': 'https://example.atlassian.net/rest/api/3/universal_avatar/view/type/project/avatar/10413?size=small',
144
- '16x16': 'https://example.atlassian.net/rest/api/3/universal_avatar/view/type/project/avatar/10413?size=xsmall',
145
- '32x32': 'https://example.atlassian.net/rest/api/3/universal_avatar/view/type/project/avatar/10413?size=medium',
146
- },
147
- },
148
- description: null,
149
- fixVersions: [],
150
- aggregatetimespent: null,
151
- statusCategory: {
152
- self: 'https://example.atlassian.net/rest/api/3/statuscategory/2',
153
- id: 2,
154
- key: 'new',
155
- colorName: 'blue-gray',
156
- name: 'To Do',
157
- },
158
- resolution: null,
159
- security: null,
160
- aggregatetimeestimate: null,
161
- resolutiondate: null,
162
- workratio: -1,
163
- summary: 'Example issue summary',
164
- watches: {
165
- self: 'https://example.atlassian.net/rest/api/3/issue/EXAMPLE-1/watchers',
166
- watchCount: 1,
167
- isWatching: true,
168
- },
169
- lastViewed: '2024-01-15T10:05:00.000+0000',
170
- creator: {
171
- self: 'https://example.atlassian.net/rest/api/3/user?accountId=111111%3A11111111-1111-1111-1111-111111111111',
172
- accountId: '111111:11111111-1111-1111-1111-111111111111',
173
- emailAddress: 'alice@example.com',
174
- avatarUrls: {
175
- '48x48': 'https://example.com/avatar/alice.png',
176
- '24x24': 'https://example.com/avatar/alice.png',
177
- '16x16': 'https://example.com/avatar/alice.png',
178
- '32x32': 'https://example.com/avatar/alice.png',
179
- },
180
- displayName: 'Alice Example',
181
- active: true,
182
- timeZone: 'UTC',
183
- accountType: 'atlassian',
184
- },
185
- subtasks: [],
186
- created: '2024-01-15T09:00:00.000+0000',
187
- reporter: {
188
- self: 'https://example.atlassian.net/rest/api/3/user?accountId=111111%3A11111111-1111-1111-1111-111111111111',
189
- accountId: '111111:11111111-1111-1111-1111-111111111111',
190
- emailAddress: 'alice@example.com',
191
- avatarUrls: {
192
- '48x48': 'https://example.com/avatar/alice.png',
193
- '24x24': 'https://example.com/avatar/alice.png',
194
- '16x16': 'https://example.com/avatar/alice.png',
195
- '32x32': 'https://example.com/avatar/alice.png',
196
- },
197
- displayName: 'Alice Example',
198
- active: true,
199
- timeZone: 'UTC',
200
- accountType: 'atlassian',
201
- },
202
- aggregateprogress: {
203
- progress: 0,
204
- total: 0,
205
- },
206
- priority: {
207
- self: 'https://example.atlassian.net/rest/api/3/priority/3',
208
- iconUrl: 'https://example.atlassian.net/images/icons/priorities/medium_new.svg',
209
- name: 'Medium',
210
- id: '3',
211
- },
212
- labels: [],
213
- environment: null,
214
- timeestimate: null,
215
- aggregatetimeoriginalestimate: null,
216
- versions: [],
217
- duedate: null,
218
- progress: {
219
- progress: 0,
220
- total: 0,
221
- },
222
- issuelinks: [],
223
- votes: {
224
- self: 'https://example.atlassian.net/rest/api/3/issue/EXAMPLE-1/votes',
225
- votes: 0,
226
- hasVoted: false,
227
- },
228
- assignee: {
229
- self: 'https://example.atlassian.net/rest/api/3/user?accountId=222222%3A22222222-2222-2222-2222-222222222222',
230
- accountId: '222222:22222222-2222-2222-2222-222222222222',
231
- emailAddress: 'bob@example.com',
232
- avatarUrls: {
233
- '48x48': 'https://example.com/avatar/bob.png',
234
- '24x24': 'https://example.com/avatar/bob.png',
235
- '16x16': 'https://example.com/avatar/bob.png',
236
- '32x32': 'https://example.com/avatar/bob.png',
237
- },
238
- displayName: 'Bob Example',
239
- active: true,
240
- timeZone: 'UTC',
241
- accountType: 'atlassian',
242
- },
243
- updated: '2024-01-15T10:00:00.000+0000',
244
- status: {
245
- self: 'https://example.atlassian.net/rest/api/3/status/10000',
246
- description: '',
247
- iconUrl: 'https://example.atlassian.net/images/icons/statuses/generic.png',
248
- name: 'To Do',
249
- id: '10000',
250
- statusCategory: {
251
- self: 'https://example.atlassian.net/rest/api/3/statuscategory/2',
252
- id: 2,
253
- key: 'new',
254
- colorName: 'blue-gray',
255
- name: 'To Do',
256
- },
257
- },
258
- },
259
- },
260
- change: {
261
- from: {
262
- accountId: null,
263
- displayName: null,
264
- },
265
- to: {
266
- accountId: '222222:22222222-2222-2222-2222-222222222222',
267
- displayName: 'Bob Example',
268
- },
269
- by: {
270
- self: 'https://example.atlassian.net/rest/api/3/user?accountId=111111%3A11111111-1111-1111-1111-111111111111',
271
- accountId: '111111:11111111-1111-1111-1111-111111111111',
272
- emailAddress: 'alice@example.com',
273
- avatarUrls: {
274
- '48x48': 'https://example.com/avatar/alice.png',
275
- '24x24': 'https://example.com/avatar/alice.png',
276
- '16x16': 'https://example.com/avatar/alice.png',
277
- '32x32': 'https://example.com/avatar/alice.png',
278
- },
279
- displayName: 'Alice Example',
280
- active: true,
281
- timeZone: 'UTC',
282
- accountType: 'atlassian',
283
- },
284
- at: '2024-01-15T10:00:00.000+0000',
285
- },
286
- },
287
- onEnable(context) {
288
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
289
- yield pieces_common_1.pollingHelper.onEnable(polling, context);
290
- });
291
- },
292
- onDisable(context) {
293
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
294
- yield pieces_common_1.pollingHelper.onDisable(polling, context);
295
- });
296
- },
297
- run(context) {
298
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
299
- return yield pieces_common_1.pollingHelper.poll(polling, context);
300
- });
301
- },
302
- test(context) {
303
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
304
- return yield pieces_common_1.pollingHelper.test(polling, context);
305
- });
306
- },
307
- });
308
- //# sourceMappingURL=issue-assigned.js.map
@@ -1 +0,0 @@
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,O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gBACJ,SAAS,EAAE,IAAI;gBACf,WAAW,EAAE,IAAI;aAClB;YACD,EAAE,EAAE;gBACF,SAAS,EAAE,6CAA6C;gBACxD,WAAW,EAAE,aAAa;aAC3B;YACD,EAAE,EAAE;gBACF,IAAI,EAAE,uGAAuG;gBAC7G,SAAS,EAAE,6CAA6C;gBACxD,YAAY,EAAE,mBAAmB;gBACjC,UAAU,EAAE;oBACV,OAAO,EAAE,sCAAsC;oBAC/C,OAAO,EAAE,sCAAsC;oBAC/C,OAAO,EAAE,sCAAsC;oBAC/C,OAAO,EAAE,sCAAsC;iBAChD;gBACD,WAAW,EAAE,eAAe;gBAC5B,MAAM,EAAE,IAAI;gBACZ,QAAQ,EAAE,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"}
@@ -1,31 +0,0 @@
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
@@ -1 +0,0 @@
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsGxB,CAAC"}
@@ -1,167 +0,0 @@
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
- aiMetadata: {
73
- description: 'Fires when a new file attachment is added to a Jira issue, optionally limited to issues matching a JQL filter. Each event represents one attachment and includes its metadata (filename, size, MIME type, author, download URL) plus the parent issue. Polling-based; events arrive on the next poll, not instantly.',
74
- },
75
- auth: auth_1.jiraCloudAuth,
76
- type: pieces_framework_1.TriggerStrategy.POLLING,
77
- props: {
78
- jql: pieces_framework_1.Property.LongText({
79
- displayName: 'Only watch these issues (optional)',
80
- description: `Narrow down which issues to watch. Leave empty to watch every issue in your Jira.
81
-
82
- Ready-to-use examples:
83
-
84
- - \`project = "SUPPORT"\` — only the Support project
85
- - \`issuetype = Bug\` — only bugs
86
- - \`labels = "screenshot-needed"\` — only issues tagged \`screenshot-needed\`
87
- - \`project = "SUPPORT" AND status != Done\` — combine with \`AND\`
88
-
89
- Not sure what to write? Open Jira → Filters → Advanced search, build a filter visually, then copy the query here.`,
90
- required: false,
91
- }),
92
- sanitizeJql: pieces_framework_1.Property.Checkbox({
93
- displayName: 'Auto-fix the filter',
94
- 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.",
95
- required: false,
96
- defaultValue: true,
97
- }),
98
- },
99
- sampleData: {
100
- issue: {
101
- id: '10001',
102
- key: 'KAN-2',
103
- summary: 'dss',
104
- },
105
- attachment: {
106
- self: 'https://Jonsworkspace-353579.atlassian.net/rest/api/3/attachment/10000',
107
- id: '10000',
108
- filename: 'image_stamped_basic-link-1 (1).pdf',
109
- author: {
110
- self: 'https://Jonsworkspace-544.atlassian.net/rest/api/3/user?accountId=dddd%3A17dca26e-0509-41b7-9bfe-d5f6b9bfa943',
111
- accountId: '712020:17dca26e-0509-41b7-9bfe-d5f6b9bfa943',
112
- emailAddress: 'Jonde57@gmail.com',
113
- avatarUrls: {
114
- '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',
115
- '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',
116
- '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',
117
- '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',
118
- },
119
- displayName: 'Jon de',
120
- active: true,
121
- timeZone: 'Asia/Kolkata',
122
- accountType: 'atlassian',
123
- },
124
- created: '2026-04-23T14:31:38.070+0530',
125
- size: 116999,
126
- mimeType: 'application/pdf',
127
- content: 'https://Jonsworkspace-s.atlassian.net/rest/api/3/attachment/content/10000',
128
- },
129
- addedBy: {
130
- self: 'https://Jonsworkspace-556.atlassian.net/rest/api/3/user?accountId=712020%3A17dca26e-0509-41b7-9bfe-d5f6b9bfa943',
131
- accountId: '712020:17dca26e-0509-41b7-9bfe-d5f6b9bfa943',
132
- emailAddress: 'Jonde57@gmail.com',
133
- avatarUrls: {
134
- '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',
135
- '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',
136
- '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',
137
- '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',
138
- },
139
- displayName: 'Jon de',
140
- active: true,
141
- timeZone: 'Asia/Kolkata',
142
- accountType: 'atlassian',
143
- },
144
- addedAt: '2026-04-23T14:31:39.121+0530',
145
- },
146
- onEnable(context) {
147
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
148
- yield pieces_common_1.pollingHelper.onEnable(polling, context);
149
- });
150
- },
151
- onDisable(context) {
152
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
153
- yield pieces_common_1.pollingHelper.onDisable(polling, context);
154
- });
155
- },
156
- run(context) {
157
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
158
- return yield pieces_common_1.pollingHelper.poll(polling, context);
159
- });
160
- },
161
- test(context) {
162
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
163
- return yield pieces_common_1.pollingHelper.test(polling, context);
164
- });
165
- },
166
- });
167
- //# sourceMappingURL=new-attachment.js.map
@@ -1 +0,0 @@
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,K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