Skip to content

Commit 2ef9043

Browse files
committed
[ACTIONS] JIRA - Create Task - the Organizations field is not applying
1 parent cd0d7f7 commit 2ef9043

File tree

28 files changed

+80
-39
lines changed

28 files changed

+80
-39
lines changed

components/jira/actions/add-attachment-to-issue/add-attachment-to-issue.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default {
66
key: "jira-add-attachment-to-issue",
77
name: "Add Attachment To Issue",
88
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)",
9-
version: "1.0.2",
9+
version: "1.0.3",
1010
type: "action",
1111
props: {
1212
jira,

components/jira/actions/add-comment-to-issue/add-comment-to-issue.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
key: "jira-add-comment-to-issue",
66
name: "Add Comment To Issue",
77
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)",
8-
version: "0.1.10",
8+
version: "0.1.11",
99
type: "action",
1010
props: {
1111
jira,

components/jira/actions/add-multiple-attachments-to-issue/add-multiple-attachments-to-issue.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default {
66
key: "jira-add-multiple-attachments-to-issue",
77
name: "Add Multiple Attachments To Issue",
88
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)",
9-
version: "1.0.2",
9+
version: "1.0.3",
1010
type: "action",
1111
props: {
1212
jira,

components/jira/actions/add-watcher-to-issue/add-watcher-to-issue.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import jira from "../../jira.app.mjs";
33
export default {
44
key: "jira-add-watcher-to-issue",
55
name: "Add Watcher To Issue",
6-
version: "0.0.9",
6+
version: "0.0.10",
77
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)",
88
type: "action",
99
props: {

components/jira/actions/assign-issue/assign-issue.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import jira from "../../jira.app.mjs";
33
export default {
44
key: "jira-assign-issue",
55
name: "Assign Issue",
6-
version: "0.0.9",
6+
version: "0.0.10",
77
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)",
88
type: "action",
99
props: {

components/jira/actions/common/issue.mjs

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -118,18 +118,20 @@ export default {
118118
async getDynamicFields({
119119
fields, predicate = (field) => field,
120120
} = {}) {
121-
const schemaTypes = Object.keys(constants.SCHEMA);
122-
123121
const keysForResourceRequest = [
124122
constants.FIELD_KEY.PARENT,
125123
constants.FIELD_KEY.LABELS,
126124
constants.FIELD_KEY.ISSUETYPE,
127125
];
126+
const keysForAutoCompleteRequest = [
127+
constants.FIELD_KEY.ASSIGNEE,
128+
constants.FIELD_KEY.ISSUELINKS,
129+
];
128130

129131
return Object.values(fields)
130132
.filter(predicate)
131133
.reduce(async (props, {
132-
schema, name: label, key, autoCompleteUrl, required,
134+
schema, name: label, key, autoCompleteUrl, required, allowedValues,
133135
}) => {
134136
const reduction = await props;
135137

@@ -150,24 +152,42 @@ export default {
150152
optional: !required,
151153
};
152154

155+
if (schemaType === "array" && Array.isArray(allowedValues)) {
156+
return Promise.resolve({
157+
...reduction,
158+
[newKey]: {
159+
...value,
160+
options: allowedValues.map(({
161+
value: label, id: value,
162+
}) => ({
163+
label,
164+
value,
165+
})),
166+
},
167+
});
168+
}
169+
153170
// Requests by URL
154-
if (schemaTypes.includes(schemaType)) {
171+
if (keysForAutoCompleteRequest.includes(key)) {
155172
try {
156-
const resources = await this.app._makeRequest({
173+
const response = await this.app._makeRequest({
157174
url: autoCompleteUrl,
158175
});
159176

160177
return Promise.resolve({
161178
...reduction,
162179
[newKey]: {
163180
...value,
164-
options: resources.map(constants.SCHEMA[schemaType].mapping),
181+
options: constants.AUTOCOMPLETE_KEY[key].getOptions(response),
165182
},
166183
});
167184

168185
} catch (error) {
169-
console.log("Error fetching resources requested by URL", autoCompleteUrl, error);
170-
return Promise.resolve(reduction);
186+
console.log("Error fetching resources requested by URL", autoCompleteUrl);
187+
return Promise.resolve({
188+
...reduction,
189+
[newKey]: value,
190+
});
171191
}
172192
}
173193

components/jira/actions/create-custom-field-options-context/create-custom-field-options-context.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
key: "jira-create-custom-field-options-context",
66
name: "Create Custom Field Options (Context)",
77
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).",
8-
version: "0.0.2",
8+
version: "0.0.3",
99
type: "action",
1010
props: {
1111
app,

components/jira/actions/create-issue/create-issue.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default {
77
key: "jira-create-issue",
88
name: "Create Issue",
99
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)",
10-
version: "0.1.21",
10+
version: "0.1.22",
1111
type: "action",
1212
props: {
1313
...common.props,

components/jira/actions/create-version/create-version.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "jira-create-version",
55
name: "Create Jira Version in project",
66
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)",
7-
version: "0.1.10",
7+
version: "0.1.11",
88
type: "action",
99
props: {
1010
jira,

components/jira/actions/delete-project/delete-project.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "jira-delete-project",
55
name: "Delete Project",
66
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)",
7-
version: "0.1.10",
7+
version: "0.1.11",
88
type: "action",
99
props: {
1010
jira,

0 commit comments

Comments
 (0)