Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 19:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Automatic Assign

Jonas Uekötter
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 7, 2016

Hello,

I have a question regarding automatic assign.

In my project I have diffrent support teams. I need a conditon where i took the value of 2 fields and than it should go to team xy. For other values it should go to an other support team. So i have 1 Ticket Type and x Support Teams.

How can i send the ticket to the correct Teams?

 

What i did:

  • post function asign to role (didn't work)

My idea:

My idea is, to work with transitions. So i creat e.g 20 open and than i can select the right one and put it all together after first seperation.

 

Is there a better solution?

JIRA Version 6.4.10

 

1 answer

0 votes
Jeff Louwerse
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 8, 2016

Unless you only ever want to do this on Create you should do this in a listener since tickets can be assigned without a transition. 

What I did was have a listener that listens for any changes to the Assignee field.  If the Assignee = Project Lead  (or null if you allow it.. or a specific user account.. the logic is up to you) then I run the check if the ticket should be assigned to someone else. 

Jonas Uekötter
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 8, 2016

Yeah i want to do it 1 time during the creat process. If its wrong it will be a manual assignment after.

Jeff Louwerse
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 8, 2016

In that case a post function on the Create transition is what you need.  You need to assign it to a user though, not a role.  I only use the listener so that if someone selects "auto assign" later it will assign based on the same logic.

 

do the logic to determine who or if there is a new user and then do something like this. .  I also throw my own event so it doesn't rerun a bunch of other listeners for no reason.

newUserName is a string containing the USERID.

if (newUserName != null && !newUserName.equals(CurrentAssignee.getName())) {
    log.debug("Update Assignee to " + newUserName);
    issue.setAssigneeId(newUserName);
    issueManager.updateIssue(userUtil.getUserObject("automation"), issue, EventDispatchOption.Factory.get(10100L), true); 
} else if (newUserName == null) {
    log.debug("New User was null. Nothing to do");
} else if (newUserName.equals(CurrentAssignee.getName())) {
    log.debug("New User from database == Current Assignee. Nothing to do");
}

Since it is a listener I also reindex it but if you do your post function right you don't need to.

Suggest an answer

Log in or Sign up to answer