Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot limit the issue number of the filter when creating boards

Eric Wang
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 17, 2025

We recently had an outage, apparently due to many mis-constructed JQL statement being used in an Agile board filter. The filter resulted in almost 500K issues being returned. Is it possible to set a limit to prevent users to use these filters when creating the board?

2 answers

0 votes
Anshul Arora
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 18, 2025

Hi Eric,

 

1) Did you try changing jira.search.views.max.limit in Jira’s advanced settings, if it is not at the default value i.e. 1000? 

2) I personally haven't used powerscript put you can try the below steps. Let me know if it helps

 

Create a custom event listener that triggers when a new board is created. The script will extract the JQL filter used in the board. Count the number of issues returned by the filter.
If the count exceeds a threshold (e.g., 10,000 issues), the script prevents board creation or logs a warning.

string boardName = argv["boardName"];
string filterId = argv["filterId"];

if (!isNull(filterId)) {
// Get the JQL from the filter
string jqlQuery = sql("jira", "SELECT jqlquery FROM searchrequest WHERE id = {filterId}", filterId);

if (!isNull(jqlQuery)) {
// Count the number of issues in the JQL filter
number issueCount = countIssues(jqlQuery);

// Set the issue limit threshold (e.g., 10,000)
number issueLimit = 10000;

if (issueCount > issueLimit) {
logError("Board creation blocked: Filter returns too many issues (" + issueCount + ")");
throw("Board creation failed: The filter retrieves " + issueCount + " issues, exceeding the allowed limit of " + issueLimit);
} else {
logInfo("Board created successfully: " + boardName);
}
}
}

0 votes
Anshul Arora
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 18, 2025

Hi Eric,

 

If you have Jira Data Center or Server, you can set a hard limit to restrict large queries by adjusting jira.search.views.max.limit in Jira’s advanced settings

If you are using Cloud and ScriptRunner plugin, you can create scripts to restrict board creation if the filter returns more than X issues.

Eg.
def jqlQuery = "your query here"
def searchResults = searchService.search(user, jqlQuery, PagerFilter.unlimitedFilter)
if (searchResults.total > 10000) {
throw new RuntimeException("Your filter returns too many issues!")
}

 

Ideally users shall not use broad filters (project = XYZ), add date or status constraints (e.g., updated >= -30d)

 

Regards,
Anshul

 

Eric Wang
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 18, 2025

Hi Anshul,

Our platform is Jira DC. We don't have ScriptRunner plugin, but we are using power script in Jira. We don't want to set a limit for issue navigator, but we'd like to prevent users from creating board from saved filter if this filter includes above 1,000 issues. Is there any solution?

 

Thanks,

Chengzhi

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events