Skip to content

Commit 9ddc6fb

Browse files
fix: BUG #19776 - add support for dropdown/select custom fields (#19804)
* fix: BUG #19776 - add support for dropdown/select custom fields * versions --------- Co-authored-by: Michelle Bergeron <michelle.bergeron@gmail.com>
1 parent f597636 commit 9ddc6fb

File tree

31 files changed

+60
-30
lines changed

31 files changed

+60
-30
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 documentation](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.8",
9+
version: "1.0.9",
1010
annotations: {
1111
destructiveHint: false,
1212
openWorldHint: true,

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
@@ -7,7 +7,7 @@ export default {
77
key: "jira-add-comment-to-issue",
88
name: "Add Comment To Issue",
99
description: "Adds a new comment to an issue. [See the documentation](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-comments/#api-rest-api-3-issue-issueidorkey-comment-post)",
10-
version: "0.1.16",
10+
version: "0.1.17",
1111
annotations: {
1212
destructiveHint: false,
1313
openWorldHint: true,

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 documentation](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.8",
9+
version: "1.0.9",
1010
annotations: {
1111
destructiveHint: false,
1212
openWorldHint: true,

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.15",
6+
version: "0.0.16",
77
annotations: {
88
destructiveHint: false,
99
openWorldHint: true,

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.15",
6+
version: "0.0.16",
77
annotations: {
88
destructiveHint: true,
99
openWorldHint: true,

components/jira/actions/check-issues-against-jql/check-issues-against-jql.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "jira-check-issues-against-jql",
55
name: "Check Issues Against JQL",
66
description: "Checks whether one or more issues would be returned by one or more JQL queries. [See the documentation](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-search/#api-rest-api-3-jql-match-post)",
7-
version: "0.0.1",
7+
version: "0.0.2",
88
type: "action",
99
annotations: {
1010
readOnlyHint: true,

components/jira/actions/common/issue.mjs

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ export default {
131131
return Object.values(fields)
132132
.filter(predicate)
133133
.reduce(async (props, {
134-
schema, name: label, key, autoCompleteUrl, required,
134+
schema, name: label, key, autoCompleteUrl, required, allowedValues,
135135
}) => {
136136
const reduction = await props;
137137

@@ -152,6 +152,21 @@ export default {
152152
optional: !required,
153153
};
154154

155+
// Handle dropdown fields (option type) with allowedValues
156+
if (schemaType === "option" && allowedValues && Array.isArray(allowedValues)) {
157+
return Promise.resolve({
158+
...reduction,
159+
[newKey]: {
160+
...value,
161+
type: "string",
162+
options: allowedValues.map((option) => ({
163+
label: option.value || option.name,
164+
value: option.id,
165+
})),
166+
},
167+
});
168+
}
169+
155170
// Requests by URL
156171
if (schemaTypes.includes(schemaType)) {
157172
try {
@@ -211,6 +226,10 @@ export default {
211226
constants.FIELD_KEY.LABELS,
212227
];
213228

229+
const fieldTypesNeedingId = [
230+
"select",
231+
];
232+
214233
return Object.entries(fields)
215234
.reduce((props, [
216235
key,
@@ -226,6 +245,16 @@ export default {
226245
? `${fieldName}_${fieldId}`
227246
: fieldName;
228247

248+
// Handle select/dropdown fields - always include with { id: value } format
249+
if (fieldTypesNeedingId.includes(fieldType)) {
250+
return {
251+
...props,
252+
[key]: {
253+
id: value,
254+
},
255+
};
256+
}
257+
229258
return {
230259
...props,
231260
[key]: keysToFormat.includes(fieldName) || fieldTypesToFormat.includes(fieldType)

components/jira/actions/count-issues-using-jql/count-issues-using-jql.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "jira-count-issues-using-jql",
55
name: "Count Issues Using JQL",
66
description: "Provide an estimated count of the issues that match the JQL. [See the documentation](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-search/#api-rest-api-3-search-approximate-count-post)",
7-
version: "0.0.1",
7+
version: "0.0.2",
88
type: "action",
99
annotations: {
1010
readOnlyHint: true,

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](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.8",
8+
version: "0.0.9",
99
annotations: {
1010
destructiveHint: false,
1111
openWorldHint: true,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default {
88
key: "jira-create-issue",
99
name: "Create Issue",
1010
description: "Creates an issue or, where the option to create subtasks is enabled in Jira, a subtask. [See the documentation](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-post)",
11-
version: "0.1.27",
11+
version: "0.1.28",
1212
annotations: {
1313
destructiveHint: false,
1414
openWorldHint: true,

0 commit comments

Comments
 (0)