Automatic Assign

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

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. 

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

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
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Bridget Sauer
Published Thursday in Marketplace Apps

Calling all developers––You're invited to Atlas Camp 2018

 Atlas Camp   is our developer event which will take place in Barcelona, Spain  from the 6th -7th of   September . This is a great opportunity to meet other developers and get n...

86 views 0 5
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you