diff --git a/components/jira/actions/add-attachment-to-issue/add-attachment-to-issue.mjs b/components/jira/actions/add-attachment-to-issue/add-attachment-to-issue.mjs index 978434f3586a9..97dbce63436fe 100644 --- a/components/jira/actions/add-attachment-to-issue/add-attachment-to-issue.mjs +++ b/components/jira/actions/add-attachment-to-issue/add-attachment-to-issue.mjs @@ -6,7 +6,7 @@ export default { key: "jira-add-attachment-to-issue", name: "Add Attachment To Issue", description: "Adds an attachment to an issue, [See the docs](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-attachments/#api-rest-api-3-issue-issueidorkey-attachments-post)", - version: "1.0.2", + version: "1.0.3", type: "action", props: { jira, diff --git a/components/jira/actions/add-comment-to-issue/add-comment-to-issue.mjs b/components/jira/actions/add-comment-to-issue/add-comment-to-issue.mjs index 17dbec1df532d..38a785206f1b9 100644 --- a/components/jira/actions/add-comment-to-issue/add-comment-to-issue.mjs +++ b/components/jira/actions/add-comment-to-issue/add-comment-to-issue.mjs @@ -5,7 +5,7 @@ export default { key: "jira-add-comment-to-issue", name: "Add Comment To Issue", description: "Adds a new comment to an issue, [See the docs](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-comments/#api-rest-api-3-issue-issueidorkey-comment-post)", - version: "0.1.10", + version: "0.1.11", type: "action", props: { jira, diff --git a/components/jira/actions/add-multiple-attachments-to-issue/add-multiple-attachments-to-issue.mjs b/components/jira/actions/add-multiple-attachments-to-issue/add-multiple-attachments-to-issue.mjs index dfca36302ab3b..cbd7bcdd721fe 100644 --- a/components/jira/actions/add-multiple-attachments-to-issue/add-multiple-attachments-to-issue.mjs +++ b/components/jira/actions/add-multiple-attachments-to-issue/add-multiple-attachments-to-issue.mjs @@ -6,7 +6,7 @@ export default { key: "jira-add-multiple-attachments-to-issue", name: "Add Multiple Attachments To Issue", description: "Adds multiple attachments to an issue, [See the docs](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-attachments/#api-rest-api-3-issue-issueidorkey-attachments-post)", - version: "1.0.2", + version: "1.0.3", type: "action", props: { jira, diff --git a/components/jira/actions/add-watcher-to-issue/add-watcher-to-issue.mjs b/components/jira/actions/add-watcher-to-issue/add-watcher-to-issue.mjs index 1a2a3caf8c4a5..84d257aa0c2f7 100644 --- a/components/jira/actions/add-watcher-to-issue/add-watcher-to-issue.mjs +++ b/components/jira/actions/add-watcher-to-issue/add-watcher-to-issue.mjs @@ -3,7 +3,7 @@ import jira from "../../jira.app.mjs"; export default { key: "jira-add-watcher-to-issue", name: "Add Watcher To Issue", - version: "0.0.9", + version: "0.0.10", description: "Adds a user as a watcher of an issue by passing the account ID of the user, For example, `5b10ac8d82e05b22cc7d4ef5`, If no user is specified the calling user is added. [See the docs](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-watchers/#api-rest-api-3-issue-issueidorkey-watchers-post)", type: "action", props: { diff --git a/components/jira/actions/assign-issue/assign-issue.mjs b/components/jira/actions/assign-issue/assign-issue.mjs index 00e99759c3d25..7523e5acde50a 100644 --- a/components/jira/actions/assign-issue/assign-issue.mjs +++ b/components/jira/actions/assign-issue/assign-issue.mjs @@ -3,7 +3,7 @@ import jira from "../../jira.app.mjs"; export default { key: "jira-assign-issue", name: "Assign Issue", - version: "0.0.9", + version: "0.0.10", description: "Assigns an issue to a user. [See the docs](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-issueidorkey-assignee-put)", type: "action", props: { diff --git a/components/jira/actions/common/issue.mjs b/components/jira/actions/common/issue.mjs index d0249e8a97bfc..255d062bd6414 100644 --- a/components/jira/actions/common/issue.mjs +++ b/components/jira/actions/common/issue.mjs @@ -118,18 +118,20 @@ export default { async getDynamicFields({ fields, predicate = (field) => field, } = {}) { - const schemaTypes = Object.keys(constants.SCHEMA); - const keysForResourceRequest = [ constants.FIELD_KEY.PARENT, constants.FIELD_KEY.LABELS, constants.FIELD_KEY.ISSUETYPE, ]; + const keysForAutoCompleteRequest = [ + constants.FIELD_KEY.ASSIGNEE, + constants.FIELD_KEY.ISSUELINKS, + ]; return Object.values(fields) .filter(predicate) .reduce(async (props, { - schema, name: label, key, autoCompleteUrl, required, + schema, name: label, key, autoCompleteUrl, required, allowedValues, }) => { const reduction = await props; @@ -150,10 +152,25 @@ export default { optional: !required, }; + if (schemaType === "array" && Array.isArray(allowedValues)) { + return Promise.resolve({ + ...reduction, + [newKey]: { + ...value, + options: allowedValues.map(({ + value: label, id: value, + }) => ({ + label, + value, + })), + }, + }); + } + // Requests by URL - if (schemaTypes.includes(schemaType)) { + if (keysForAutoCompleteRequest.includes(key)) { try { - const resources = await this.app._makeRequest({ + const response = await this.app._makeRequest({ url: autoCompleteUrl, }); @@ -161,13 +178,16 @@ export default { ...reduction, [newKey]: { ...value, - options: resources.map(constants.SCHEMA[schemaType].mapping), + options: constants.AUTOCOMPLETE_KEY[key].getOptions(response), }, }); } catch (error) { - console.log("Error fetching resources requested by URL", autoCompleteUrl, error); - return Promise.resolve(reduction); + console.log("Error fetching resources requested by URL", autoCompleteUrl); + return Promise.resolve({ + ...reduction, + [newKey]: value, + }); } } diff --git a/components/jira/actions/create-custom-field-options-context/create-custom-field-options-context.mjs b/components/jira/actions/create-custom-field-options-context/create-custom-field-options-context.mjs index c3311b633a9c7..83fbb1b751525 100644 --- a/components/jira/actions/create-custom-field-options-context/create-custom-field-options-context.mjs +++ b/components/jira/actions/create-custom-field-options-context/create-custom-field-options-context.mjs @@ -5,7 +5,7 @@ export default { key: "jira-create-custom-field-options-context", name: "Create Custom Field Options (Context)", description: "Create a context for custom field options. [See the documentation here](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-custom-field-options/#api-rest-api-3-field-fieldid-context-contextid-option-post).", - version: "0.0.2", + version: "0.0.3", type: "action", props: { app, diff --git a/components/jira/actions/create-issue/create-issue.mjs b/components/jira/actions/create-issue/create-issue.mjs index 4723106ab1cd4..416c1d9cc7e7c 100644 --- a/components/jira/actions/create-issue/create-issue.mjs +++ b/components/jira/actions/create-issue/create-issue.mjs @@ -7,7 +7,7 @@ export default { key: "jira-create-issue", name: "Create Issue", description: "Creates an issue or, where the option to create subtasks is enabled in Jira, a subtask, [See the docs](https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-rest-api-3-issue-post)", - version: "0.1.21", + version: "0.1.22", type: "action", props: { ...common.props, diff --git a/components/jira/actions/create-version/create-version.mjs b/components/jira/actions/create-version/create-version.mjs index 0a2a9bb071330..65bc4523d9073 100644 --- a/components/jira/actions/create-version/create-version.mjs +++ b/components/jira/actions/create-version/create-version.mjs @@ -4,7 +4,7 @@ export default { key: "jira-create-version", name: "Create Jira Version in project", description: "Creates a project version., [See the docs](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-project-versions/#api-rest-api-3-version-post)", - version: "0.1.10", + version: "0.1.11", type: "action", props: { jira, diff --git a/components/jira/actions/delete-project/delete-project.mjs b/components/jira/actions/delete-project/delete-project.mjs index 8b7b3d5424c93..fcad59986a38b 100644 --- a/components/jira/actions/delete-project/delete-project.mjs +++ b/components/jira/actions/delete-project/delete-project.mjs @@ -4,7 +4,7 @@ export default { key: "jira-delete-project", name: "Delete Project", description: "Deletes a project, [See the docs](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-projects/#api-rest-api-3-project-projectidorkey-delete)", - version: "0.1.10", + version: "0.1.11", type: "action", props: { jira, diff --git a/components/jira/actions/get-all-projects/get-all-projects.mjs b/components/jira/actions/get-all-projects/get-all-projects.mjs index 42c92dd5f1a49..1df3158dbfb46 100644 --- a/components/jira/actions/get-all-projects/get-all-projects.mjs +++ b/components/jira/actions/get-all-projects/get-all-projects.mjs @@ -4,7 +4,7 @@ export default { key: "jira-get-all-projects", name: "Get All Projects", description: "Gets metadata on all projects, [See the docs](https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-rest-api-3-project-get)", - version: "0.1.11", + version: "0.1.12", type: "action", props: { jira, diff --git a/components/jira/actions/get-issue/get-issue.mjs b/components/jira/actions/get-issue/get-issue.mjs index cad55f21eea39..0061ef921a6d5 100644 --- a/components/jira/actions/get-issue/get-issue.mjs +++ b/components/jira/actions/get-issue/get-issue.mjs @@ -4,7 +4,7 @@ export default { key: "jira-get-issue", name: "Get Issue", description: "Gets the details for an issue. [See the docs](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-issueidorkey-get)", - version: "0.1.12", + version: "0.1.13", type: "action", props: { jira, diff --git a/components/jira/actions/get-task/get-task.mjs b/components/jira/actions/get-task/get-task.mjs index 458dcb635a9d6..2a2cfd02dcd9a 100644 --- a/components/jira/actions/get-task/get-task.mjs +++ b/components/jira/actions/get-task/get-task.mjs @@ -4,7 +4,7 @@ export default { key: "jira-get-task", name: "Get Task", description: "Gets the status of a long-running asynchronous task, [See the docs](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-tasks/#api-rest-api-3-task-taskid-get)", - version: "0.1.10", + version: "0.1.11", type: "action", props: { jira, diff --git a/components/jira/actions/get-transitions/get-transitions.mjs b/components/jira/actions/get-transitions/get-transitions.mjs index 2d353c36c4f38..facfb3aeddb6b 100644 --- a/components/jira/actions/get-transitions/get-transitions.mjs +++ b/components/jira/actions/get-transitions/get-transitions.mjs @@ -4,7 +4,7 @@ export default { key: "jira-get-transitions", name: "Get Transitions", description: "Gets either all transitions or a transition that can be performed by the user on an issue, based on the issue's status, [See the docs](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-issueidorkey-transitions-get)", - version: "0.1.10", + version: "0.1.11", type: "action", props: { jira, diff --git a/components/jira/actions/get-user/get-user.mjs b/components/jira/actions/get-user/get-user.mjs index 3caaf78809953..a0f94caccdcc2 100644 --- a/components/jira/actions/get-user/get-user.mjs +++ b/components/jira/actions/get-user/get-user.mjs @@ -4,7 +4,7 @@ export default { key: "jira-get-user", name: "Get User", description: "Gets details of user, [See the docs](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-users/#api-rest-api-3-user-get)", - version: "0.1.10", + version: "0.1.11", type: "action", props: { jira, diff --git a/components/jira/actions/get-users/get-users.mjs b/components/jira/actions/get-users/get-users.mjs index 54f10ccff3487..b4dbeb4268eda 100644 --- a/components/jira/actions/get-users/get-users.mjs +++ b/components/jira/actions/get-users/get-users.mjs @@ -4,7 +4,7 @@ export default { key: "jira-get-users", name: "Get Users", description: "Gets details of a list of users. [See docs here](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-user-search/#api-rest-api-3-user-search-get)", - version: "0.0.5", + version: "0.0.6", type: "action", props: { jira, diff --git a/components/jira/actions/list-issue-comments/list-issue-comments.mjs b/components/jira/actions/list-issue-comments/list-issue-comments.mjs index e491b2e397209..6c89ded848e36 100644 --- a/components/jira/actions/list-issue-comments/list-issue-comments.mjs +++ b/components/jira/actions/list-issue-comments/list-issue-comments.mjs @@ -4,7 +4,7 @@ export default { key: "jira-list-issue-comments", name: "List Issue Comments", description: "Lists all comments for an issue, [See the docs](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-comments/#api-rest-api-3-issue-issueidorkey-comment-get)", - version: "0.1.10", + version: "0.1.11", type: "action", props: { jira, diff --git a/components/jira/actions/search-issues-with-jql/search-issues-with-jql.mjs b/components/jira/actions/search-issues-with-jql/search-issues-with-jql.mjs index bf0e753f8c800..7e756ec51e923 100644 --- a/components/jira/actions/search-issues-with-jql/search-issues-with-jql.mjs +++ b/components/jira/actions/search-issues-with-jql/search-issues-with-jql.mjs @@ -4,7 +4,7 @@ export default { name: "Search Issues with JQL", description: "Search for issues using JQL (Jira Query Language). [See the documentation](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-search/#api-rest-api-3-search-jql-get)", key: "jira-search-issues-with-jql", - version: "0.0.2", + version: "0.0.3", type: "action", props: { jira, diff --git a/components/jira/actions/transition-issue/transition-issue.mjs b/components/jira/actions/transition-issue/transition-issue.mjs index 0f3e6539ead76..c76a163a0bc61 100644 --- a/components/jira/actions/transition-issue/transition-issue.mjs +++ b/components/jira/actions/transition-issue/transition-issue.mjs @@ -5,7 +5,7 @@ export default { key: "jira-transition-issue", name: "Transition Issue", description: "Performs an issue transition and, if the transition has a screen, updates the fields from the transition screen, [See the docs](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-issueidorkey-transitions-post)", - version: "0.1.12", + version: "0.1.13", type: "action", props: { jira, diff --git a/components/jira/actions/update-comment/update-comment.mjs b/components/jira/actions/update-comment/update-comment.mjs index 0e5ab14cf57d8..365c69c7742e3 100644 --- a/components/jira/actions/update-comment/update-comment.mjs +++ b/components/jira/actions/update-comment/update-comment.mjs @@ -5,7 +5,7 @@ export default { key: "jira-update-comment", name: "Update Comment", description: "Updates a comment, [See the docs](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-comments/#api-rest-api-3-issue-issueidorkey-comment-id-put)", - version: "0.1.10", + version: "0.1.11", type: "action", props: { jira, diff --git a/components/jira/actions/update-issue/update-issue.mjs b/components/jira/actions/update-issue/update-issue.mjs index 0a4413d42311a..01ff1a684e263 100644 --- a/components/jira/actions/update-issue/update-issue.mjs +++ b/components/jira/actions/update-issue/update-issue.mjs @@ -8,7 +8,7 @@ export default { key: "jira-update-issue", name: "Update Issue", description: "Updates an issue. A transition may be applied and issue properties updated as part of the edit, [See the docs](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-issueidorkey-put)", - version: "0.2.14", + version: "0.2.15", type: "action", props: { ...common.props, diff --git a/components/jira/common/constants.mjs b/components/jira/common/constants.mjs index e9d12c30fa197..213f8c03697da 100644 --- a/components/jira/common/constants.mjs +++ b/components/jira/common/constants.mjs @@ -17,6 +17,30 @@ const FIELD_KEY = { ASSIGNEE: "assignee", PARENT: "parent", LABELS: "labels", + ISSUELINKS: "issuelinks", +}; + +const AUTOCOMPLETE_KEY = { + assignee: { + getOptions: (response) => { + return response.map(({ + displayName: label, accountId: value, + }) => ({ + label, + value, + })); + }, + }, + issuelinks: { + getOptions: (response) => { + return response.sections.flatMap(({ issues }) => issues.map(({ + summary: label, key: value, + }) => ({ + label, + value, + }))); + }, + }, }; const FIELD_TYPE = { @@ -42,4 +66,5 @@ export default { FIELD_TYPE, SCHEMA, DEFAULT_LIMIT, + AUTOCOMPLETE_KEY, }; diff --git a/components/jira/package.json b/components/jira/package.json index f26452d109cc0..e9061a6493bc0 100644 --- a/components/jira/package.json +++ b/components/jira/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/jira", - "version": "1.0.2", + "version": "1.0.3", "description": "Pipedream Jira Components", "main": "jira.app.mjs", "keywords": [ diff --git a/components/jira/sources/events/events.mjs b/components/jira/sources/events/events.mjs index d2e54f6b5d6f1..7aa53282e1b60 100644 --- a/components/jira/sources/events/events.mjs +++ b/components/jira/sources/events/events.mjs @@ -5,7 +5,7 @@ export default { key: "jira-events", name: "New Event", description: "Emit new event when an event with subscribed event source triggered, [See the docs](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-webhooks/#api-rest-api-3-webhook-post)", - version: "0.0.11", + version: "0.0.12", type: "source", dedupe: "unique", ...common, diff --git a/components/jira/sources/issue-created/issue-created.mjs b/components/jira/sources/issue-created/issue-created.mjs index 8cb2f3be41826..ed633a4c58e19 100644 --- a/components/jira/sources/issue-created/issue-created.mjs +++ b/components/jira/sources/issue-created/issue-created.mjs @@ -4,7 +4,7 @@ export default { key: "jira-issue-created", name: "New Issue Created Event (Instant)", description: "Emit new event when an issue is created. Note that Jira supports only one webhook, if more sources are needed please use `New Event` source and select multiple events.", - version: "0.0.11", + version: "0.0.12", type: "source", dedupe: "unique", ...common, diff --git a/components/jira/sources/issue-deleted/issue-deleted.mjs b/components/jira/sources/issue-deleted/issue-deleted.mjs index 5abbd63ea09c5..e4dcde07039b8 100644 --- a/components/jira/sources/issue-deleted/issue-deleted.mjs +++ b/components/jira/sources/issue-deleted/issue-deleted.mjs @@ -4,7 +4,7 @@ export default { key: "jira-issue-deleted", name: "New Issue Deleted Event (Instant)", description: "Emit new event when an issue is deleted. Note that Jira supports only one webhook, if more sources are needed please use `New Event` source and select multiple events.", - version: "0.0.11", + version: "0.0.12", type: "source", dedupe: "unique", ...common, diff --git a/components/jira/sources/issue-updated/issue-updated.mjs b/components/jira/sources/issue-updated/issue-updated.mjs index 7999b96cdd3ea..9877bde798058 100644 --- a/components/jira/sources/issue-updated/issue-updated.mjs +++ b/components/jira/sources/issue-updated/issue-updated.mjs @@ -4,7 +4,7 @@ export default { key: "jira-issue-updated", name: "New Issue Updated Event (Instant)", description: "Emit new event when an issue is updated. Note that Jira supports only one webhook, if more sources are needed please use `New Event` source and select multiple events.", - version: "0.0.11", + version: "0.0.12", type: "source", dedupe: "unique", ...common, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7a15644cf89d5..4bcb3d9d521ee 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4073,8 +4073,7 @@ importers: specifier: ^1.5.1 version: 1.6.6 - components/dynamic_content_snippet: - specifiers: {} + components/dynamic_content_snippet: {} components/dynamics_365_business_central_api: dependencies: @@ -14896,8 +14895,7 @@ importers: specifier: ^3.0.0 version: 3.0.3 - components/wbiztool: - specifiers: {} + components/wbiztool: {} components/wealthbox: dependencies: @@ -37322,8 +37320,6 @@ snapshots: '@putout/operator-filesystem': 5.0.0(putout@36.13.1(eslint@8.57.1)(typescript@5.6.3)) '@putout/operator-json': 2.2.0 putout: 36.13.1(eslint@8.57.1)(typescript@5.6.3) - transitivePeerDependencies: - - supports-color '@putout/operator-regexp@1.0.0(putout@36.13.1(eslint@8.57.1)(typescript@5.6.3))': dependencies: