You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: components/zendesk/actions/search-tickets/search-tickets.mjs
+19-20Lines changed: 19 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ export default {
5
5
name: "Search Tickets",
6
6
description: "Searches for tickets using Zendesk's search API. [See the documentation](https://developer.zendesk.com/api-reference/ticketing/ticket-management/search/#search-tickets).",
7
7
type: "action",
8
-
version: "0.0.4",
8
+
version: "0.0.5",
9
9
props: {
10
10
app,
11
11
query: {
@@ -37,6 +37,13 @@ export default {
37
37
"customSubdomain",
38
38
],
39
39
},
40
+
page: {
41
+
type: "integer",
42
+
label: "Page",
43
+
description: "The page number to retrieve. Default is 1.",
44
+
default: 1,
45
+
optional: true,
46
+
},
40
47
},
41
48
asyncrun({$: step}){
42
49
const{
@@ -47,28 +54,20 @@ export default {
47
54
customSubdomain,
48
55
}=this;
49
56
50
-
constresults=this.app.paginate({
51
-
fn: this.app.searchTickets,
52
-
args: {
53
-
step,
54
-
customSubdomain,
55
-
params: {
56
-
query,
57
-
sort_by: sortBy,
58
-
sort_order: sortOrder,
59
-
},
57
+
constresults=awaitthis.app.searchTickets({
58
+
step,
59
+
customSubdomain,
60
+
params: {
61
+
query,
62
+
sort_by: sortBy,
63
+
sort_order: sortOrder,
64
+
per_page: limit,
65
+
page: this.page,
60
66
},
61
-
resourceKey: "results",
62
-
max: limit,
63
67
});
64
68
65
-
consttickets=[];
66
-
forawait(constticketofresults){
67
-
tickets.push(ticket);
68
-
}
69
-
70
-
step.export("$summary",`Successfully found ${tickets.length} tickets matching the search query`);
69
+
step.export("$summary","Successfully retrieved tickets matching the search query");
0 commit comments