Skip to content

[ACTIONS] JIRA - Create Task - the Organizations field is not applying #17799

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
2 changes: 1 addition & 1 deletion components/jira/actions/assign-issue/assign-issue.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
36 changes: 28 additions & 8 deletions components/jira/actions/common/issue.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -150,24 +152,42 @@ 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,
});

return Promise.resolve({
...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,
});
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion components/jira/actions/create-issue/create-issue.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion components/jira/actions/create-version/create-version.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion components/jira/actions/delete-project/delete-project.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion components/jira/actions/get-issue/get-issue.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion components/jira/actions/get-task/get-task.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion components/jira/actions/get-user/get-user.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion components/jira/actions/get-users/get-users.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion components/jira/actions/update-comment/update-comment.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion components/jira/actions/update-issue/update-issue.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
25 changes: 25 additions & 0 deletions components/jira/common/constants.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -42,4 +66,5 @@ export default {
FIELD_TYPE,
SCHEMA,
DEFAULT_LIMIT,
AUTOCOMPLETE_KEY,
};
2 changes: 1 addition & 1 deletion components/jira/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/jira",
"version": "1.0.2",
"version": "1.0.3",
"description": "Pipedream Jira Components",
"main": "jira.app.mjs",
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion components/jira/sources/events/events.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion components/jira/sources/issue-created/issue-created.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion components/jira/sources/issue-deleted/issue-deleted.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion components/jira/sources/issue-updated/issue-updated.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
8 changes: 2 additions & 6 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading