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/jira/actions/search-issues-with-jql/search-issues-with-jql.mjs
+59-8Lines changed: 59 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ export default {
4
4
name: "Search Issues with JQL",
5
5
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)",
6
6
key: "jira-search-issues-with-jql",
7
-
version: "0.0.4",
7
+
version: "0.1.0",
8
8
type: "action",
9
9
props: {
10
10
jira,
@@ -17,16 +17,16 @@ export default {
17
17
jql: {
18
18
type: "string",
19
19
label: "JQL Query",
20
-
description: "The [JQL](https://support.atlassian.com/jira-software-cloud/docs/what-is-advanced-search-in-jira-cloud/) query to search for issues",
20
+
description: "The JQL query to search for issues. [See the documentation for syntax and examples](https://support.atlassian.com/jira-software-cloud/docs/what-is-advanced-search-in-jira-cloud/)",
21
21
},
22
22
maxResults: {
23
23
type: "integer",
24
24
label: "Max Results",
25
-
description: "Maximum number of issues to return (default: 50, max: 100)",
25
+
description: "Maximum number of issues to return (default: 50)",
26
26
optional: true,
27
27
default: 50,
28
28
min: 1,
29
-
max: 100,
29
+
max: 5000,
30
30
},
31
31
fields: {
32
32
type: "string",
@@ -90,14 +90,62 @@ export default {
90
90
optional: true,
91
91
},
92
92
},
93
+
methods: {
94
+
getMaxResultsPerPage(){
95
+
returnMath.min(this.maxResults,1000);
96
+
},
97
+
asyncpaginate({
98
+
params, maxResults, ...otherArgs
99
+
}){
100
+
constresults=[];
101
+
letnextPageToken;
102
+
letresponse;
103
+
104
+
do{
105
+
response=awaitthis.jira.searchIssues({
106
+
...otherArgs,
107
+
params: {
108
+
...params,
109
+
...(nextPageToken&&{
110
+
nextPageToken,
111
+
}),
112
+
},
113
+
});
114
+
115
+
constpageResults=response.issues;
116
+
constpageLength=pageResults?.length;
117
+
if(!pageLength){
118
+
break;
119
+
}
120
+
121
+
// If maxResults is specified, only add what we need
0 commit comments