Skip to content

Commit aac5bf0

Browse files
committed
feat(jira_service_desk): replace async-options with standalone actions
1 parent 989fb9f commit aac5bf0

13 files changed

Lines changed: 40 additions & 74 deletions

File tree

components/jira_service_desk/actions/create-comment-on-request/create-comment-on-request.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "jira_service_desk-create-comment-on-request",
55
name: "Create Comment on Request",
66
description: "Create a comment on a customer request. [See the documentation](https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-request/#api-rest-servicedeskapi-request-issueidorkey-comment-post)",
7-
version: "0.0.4",
7+
version: "0.1.0",
88
annotations: {
99
destructiveHint: false,
1010
openWorldHint: true,

components/jira_service_desk/actions/get-request-status/get-request-status.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export default {
99
+ " Use **List Sites** first to obtain the required `cloudId`."
1010
+ " Use **List My Requests** to find the `issueKey` (e.g. `IT-42`)."
1111
+ " [See the documentation](https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-request/#api-rest-servicedeskapi-request-issueidorkey-status-get)",
12-
version: "0.0.2",
12+
version: "0.1.0",
1313
type: "action",
1414
annotations: {
1515
destructiveHint: false,

components/jira_service_desk/actions/get-request/get-request.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export default {
99
+ " Use **List Sites** first to obtain the required `cloudId`."
1010
+ " Use **List My Requests** to find the `issueKey` of a request (e.g. `IT-42`)."
1111
+ " [See the documentation](https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-request/#api-rest-servicedeskapi-request-issueidorkey-get)",
12-
version: "0.0.2",
12+
version: "0.1.0",
1313
type: "action",
1414
annotations: {
1515
destructiveHint: false,

components/jira_service_desk/actions/list-cloud-id-options/list-cloud-id-options.mjs

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import jira_service_desk from "../../jira_service_desk.app.mjs";
33
export default {
44
key: "jira_service_desk-list-cloud-id-options",
55
name: "List Cloud ID Options",
6-
description: "Retrieves available options for the Cloud ID field.",
7-
version: "0.0.3",
6+
description: "Lists the Atlassian sites you can raise requests on, as `{label, value}` options, to discover the `cloudId` every other Jira Service Desk tool needs. Takes no input beyond the account. Example: returns `[{ \"label\": \"acme\", \"value\": \"822faf0d-5427-420e-9016-999d3dc76918\" }]`. Use **List Sites** instead if you want the full site records. [See the documentation](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps/#3-1-get-the-cloudid-for-your-site)",
7+
version: "0.1.0",
88
type: "action",
99
annotations: {
1010
destructiveHint: false,
@@ -15,8 +15,17 @@ export default {
1515
jira_service_desk,
1616
},
1717
async run({ $ }) {
18-
const options = await jira_service_desk.propDefinitions.cloudId.options
19-
.call(this.jira_service_desk);
18+
const sites = await this.jira_service_desk.getSites({
19+
$,
20+
});
21+
const options = sites
22+
?.filter?.(({ scopes }) => scopes?.includes("write:servicedesk-request"))
23+
?.map?.(({
24+
id, name,
25+
}) => ({
26+
label: name,
27+
value: id,
28+
})) ?? [];
2029
$.export("$summary", `Successfully retrieved ${options.length} option${options.length === 1
2130
? ""
2231
: "s"}`);

components/jira_service_desk/actions/list-my-requests/list-my-requests.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export default {
1111
+ " `requestStatus`: `OPEN_REQUESTS` (default), `CLOSED_REQUESTS`, or `ALL_REQUESTS`."
1212
+ " `requestOwnership`: `OWNED_REQUESTS` (default) or `PARTICIPATED_REQUESTS`."
1313
+ " [See the documentation](https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-request/#api-rest-servicedeskapi-request-get)",
14-
version: "0.0.2",
14+
version: "0.1.0",
1515
type: "action",
1616
annotations: {
1717
destructiveHint: false,

components/jira_service_desk/actions/list-request-transitions/list-request-transitions.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export default {
99
+ " Use **List Sites** first to obtain the required `cloudId`."
1010
+ " Use **List My Requests** or **Get Request** to find the `issueKey` (e.g. `IT-42`)."
1111
+ " [See the documentation](https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-request/#api-rest-servicedeskapi-request-issueidorkey-transition-get)",
12-
version: "0.0.2",
12+
version: "0.1.0",
1313
type: "action",
1414
annotations: {
1515
destructiveHint: false,

components/jira_service_desk/actions/list-request-type-fields/list-request-type-fields.mjs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,11 @@ export default {
5151
description: "The request type whose fields to list. Use **List Request Types** to find valid IDs (e.g. `4`).",
5252
},
5353
expand: {
54-
type: "string[]",
55-
label: "Expand",
54+
propDefinition: [
55+
app,
56+
"expand",
57+
],
5658
description: "Extra data to include. Pass `hiddenFields` to also return fields hidden on the request type, which only a service desk administrator can see.",
57-
optional: true,
5859
},
5960
},
6061
async run({ $ }) {

components/jira_service_desk/actions/list-request-types/list-request-types.mjs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,11 @@ export default {
6767
optional: true,
6868
},
6969
expand: {
70-
type: "string[]",
71-
label: "Expand",
70+
propDefinition: [
71+
app,
72+
"expand",
73+
],
7274
description: "Extra data to include on each request type. Pass `field` to return the type's fields inline, which saves a follow-up **List Request Type Fields** call.",
73-
optional: true,
7475
},
7576
},
7677
async run({ $ }) {

components/jira_service_desk/actions/transition-request/transition-request.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export default {
1010
+ " Use **List My Requests** or **Get Request** to find the `issueKey` (e.g. `IT-42`)."
1111
+ " Optionally include a comment to explain the transition."
1212
+ " [See the documentation](https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-request/#api-rest-servicedeskapi-request-issueidorkey-transition-post)",
13-
version: "0.0.2",
13+
version: "0.1.0",
1414
type: "action",
1515
annotations: {
1616
destructiveHint: false,

components/jira_service_desk/actions/update-issue-fields/update-issue-fields.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export default {
1111
+ " `fields` is a JSON object of field name-value pairs."
1212
+ " Example: `{\"summary\": \"Updated title\", \"priority\": {\"name\": \"High\"}}`."
1313
+ " [See the documentation](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-issueidorkey-put)",
14-
version: "0.0.2",
14+
version: "0.1.0",
1515
type: "action",
1616
annotations: {
1717
destructiveHint: false,

0 commit comments

Comments
 (0)