Hello Expert,
Can you please support me for script for auto assignment from jira groups.
I don’t even find the solution anywhere.
Thanks,
Mathavan M
Hi, @Mathavan
Wht do you mean by "auto assignment from jira groups" ? Assignement can be done to separate person, not group. What is the logic, you're trying to implement?
Auto assignment “round robin” method from jira ldap groups.
When issue created we need to assign the ticket to person from ldap groups.
looking forward to hearing from you.
Mathavan
Based on what you mentioned above, you would like to assign an issue after issue creation.
That means the best way to go is a post function in the workflow.
In a post function you have access to some variables. Therefore, you can use the "issue" variable to get the current issue.
The rest can be achieved by the following code. I used the first group and user, but this can be adjusted according to any kind of algorithm. Be sure to put the custom script post function AFTER the "Issue Created" event so that it can be correctly be handled in Jira:
import com.atlassian.jira.component.ComponentAccessorimport com.atlassian.jira.event.type.EventDispatchOptiondef groups = ComponentAccessor.groupManager.getAllGroupNames()def users = ComponentAccessor.groupManager.getUsersInGroup(groups.first())issue.assignee = users.first()ComponentAccessor.issueManager.updateIssue(ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser(),issue, EventDispatchOption.ISSUE_UPDATED,true)
@Mathavan for auto-assignement with round-robin from users in group you can use standard jira automation. It allows such functionality.Using scriptrunner is possible, but not sure how to make "round-robin" with it. You'll need to save, who was assigned previously.
Hello @Stefan Stadler
I am looking for the script Round Robin Auto Assignment.Use Case:
We have multiple services and Each service has different support team, Each support team has a Jira group.
When ticket is created one of the service, it should assigned to respective team in round robin method.
We tried Jira Automation but, bit slow for assignment.Can you help with this?
Thanks,Mathavan
Hi Mathavan,
maybe this post can help here.
As I said, the logic can be changed according to the needs, so this might be seen as a starting point for your own modifications:
Updating assignee field using Groovy script Postfu... (atlassian.com)
Hi @Mathavan
there is also some documentation on Round Robin using ScriptRunner:
Round Robin Assign Issue to Users in a Certain Project Role - Adaptavist Library
You may put together both posts and get your solution
It looks like you're new here. Sign in or register to get started.