/
Filter based on multiple criteria by using a non-Boolean JQL function
Filter based on multiple criteria by using a non-Boolean JQL function
You want to filter issues based on two or more criteria. However, this can’t be achieved by using the typical boolean operators in standard JQL.
Enter the below silJQL script to display a list of all issues that meet your preferred criteria.
Example usage (JQL query)
key in silJQLList("silJQL_FindTwoOrMoreCriteria.sil", PROJ)
Script
string [] keys = selectIssues("project= " + argv[0]);
string [] ret;
for(string k in keys){
int criteriaCount = 0;
if(arrayElementExists(%k%.labels, "criteria")) {
criteriaCount ++;
}
if(%k%.assignee == %k%.reporter) {
criteriaCount ++;
}
if(isNull(%k%.desc)) {
criteriaCount ++;
}
if(arrayElementExists(%k%.components, "JIRA")) {
criteriaCount ++;
}
if(%k%.priority == "Major") {
criteriaCount ++;
}
if(criteriaCount >=2) {
ret += k;
}
}
return ret;
, multiple selections available,
Related content
Create custom JQL functions for nested issue reporting
Create custom JQL functions for nested issue reporting
Read with this
JQL functions reference
JQL functions reference
More like this
JQL reference
JQL reference
More like this
selectIssues
selectIssues
More like this
selectIssues
selectIssues
More like this
Power Scripts for Jira
Power Scripts for Jira
Read with this