Forums

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

How do I set default assignee for custom field?

Ilaria Fazio
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!
July 23, 2019

Hello, we have a custom field that is called FOR SQUAD, which is simply a pick up menu to choose a team. I'd like to set a default assignee per team but I couldn't find an option. Can somebody help?

2 answers

1 vote
PVS
Banned
July 23, 2019

Hi @Ilaria Fazio 

 

 

If You Have Script Runner Plugin 

 

Here it is. It could be some changed based on custom field type.

 

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.MutableIssue

String userName;

switch(ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("fieldname").toString()){
    case "1": userName = "user1";break;
    case "2": userName = "user2";break;
    case "3": userName = "user3";break;    
}

issue.setAssignee(ComponentAccessor.getUserManager().getUserByName(userName))

 Cheers 

1 vote
Joe Pitt
Community Champion
July 23, 2019

If I understand you correctly, you have a select list with a set of teams. The user picks a team and you want JIRA, in the background, to select a particular member of the team the user picks. That can't be done out of the box. You would need  a plugin or some scripting. 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events