Forums

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

Auto-assignment of user from group to issues..

Rutuja Pawal
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!
February 7, 2020

I write code to for the same but still issues is not auto assigned .

can anyone help me out for the same.

 

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.bc.group.search.GroupPickerSearchService
import com.atlassian.crowd.embedded.api.Group

def groupSearch = ComponentAccessor.getComponent(GroupPickerSearchService)
def groupList = groupSearch.findGroups("")
def groupManager = ComponentAccessor.getGroupManager()

for (Group group in groupList)
{
log.error group.getName().toString()//print group names to log
log.error groupManager.getUsersInGroup(group)//print group members to log
}


int countIssues;
String username;
String [] groupUser;
String [] groups = {argv[0]};

groupUser = groupManager.getUsersInGroup(group);


for(String u in groupUsers)
{
String jql = "project= pune 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;

 

1 answer

0 votes
Thomas Deiler
Community Champion
February 7, 2020

Dear @Rutuja Pawal ,

it seems that you question is better placed at https://community.developer.atlassian.com/.

Could you be so kind to reopen it there?

So long

Thomas

Suggest an answer

Log in or Sign up to answer