Skip to end of banner
Go to start of banner

Assign issues automatically based on workload

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Current »

This function returns the user in the group that has the least number of issues
the function takes a group name as an input parameter.

To invoke, you'd script like this:

string user = getUserLeastIssues("auto-assign-users");

Script

string username;
int countIssues;
string [] groupUsers;
string [] groups = {argv[0]};
    
groupUsers = usersInGroups(groups);
    
for(string u in groupUsers) {
        
    string jql = "project = EX AND statusCategory in (\"To Do\", \"In Progress\") and assignee = " + u;
    int tempCount = countIssues(jql);
        
    if(isNull(username) || (countIssues > tempCount)) {
        username = u;
        countIssues = tempCount;
    }
}
    
return username;
  • No labels