I have a part of script . On Jira 7 this script succesfully working , but in jira 6.4 I see an error illegalArgument exception (in line with "def PriorityQueue") . Code:
How to fix it?
class Agent {
ApplicationUser user;
int issueCount;
long lastAssignedTime;
}
def groups = ComponentAccessor.getGroupManager() as GroupManager
def agents = groups.getUsersInGroup("jira-software-users")
def userManager = ComponentAccessor.getUserManager() as UserManager
def user = ComponentAccessor.jiraAuthenticationContext.loggedInUser
def jqlQueryParser = ComponentAccessor.getComponent(JqlQueryParser.class)
def searchProvider = ComponentAccessor.getComponent(SearchProvider.class)
def PriorityQueue<Agent> agentPQ = new PriorityQueue<>(agents.size(), new Comparator<Agent>() {
@Override
int compare(Agent o1, Agent o2) {
if(o1.issueCount == o2.issueCount){
if(o2.lastAssignedTime == o1.lastAssignedTime){
return o1.user.name.compareTo(o2.user.name)
}else{
return o1.lastAssignedTime.compareTo(o2.lastAssignedTime)
}
}else{
return o1.issueCount - o2.issueCount
}
}
})