Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Round Robin assignment based on user roles when the assignee can be in multiple roles

I am looking to do round robin assignment using Automation Lite for Jira or possibly Scriptrunner for Jira Server 8.13

I set up a general role that holds all assignees for round robin assignment.  I also set up user roles representing skillsets.  Assignees may be in more than one "skillset" role.

  • Current State
    • Using Automation Lite, I set up a master timed job that runs every 11 minutes and checks the assign user column to see if there are any tickets ready for assignment
    • Any tickets in the column are updated round robin from the "General Role"
    • I then have 13 different "skillset" jobs running every 5 minutes checking that same column to see if the user is assigned to the respective "skillset" role which is based off of a custom skillset field.  
    • If there is a match, it moves it into the assigned column and the user gets a notification
    • If the user is not a match, it does nothing and waits for the 11 minute job to reassign it.
    • This continues until a match is found.

 

The 11 minute and 5 minute rules work well.  The issue is that when a match is not found, instead of returning back to the user that wasn't a match, it moves on to the next person.  This means a lot of people are getting skipped and people with more skillsets are getting more assignments.

Any idea how I can solve for this?  I also tried balanced workload but it did not seem to do anything and seemed to assign the same people over and over for some reason.

1 answer

Hi @Jillian Menoche Welcome to Atlassian Community!

You can achieve this using Script Runner , kindly check below link for round robin :- 

https://library.adaptavist.com/entity/round-robin-assign-issue-to-users-in-a-certain-project-role

Thanks

Thank you for the quick response! 

 

I should mention I saw this link and pasted the code in but couldn't get off the ground as it gave me the following error at line 17:  can't find method projectRoleManager.getProjectRoleActors(projectRole, issue.projectObject)

 

any thoughts on what may be happening there?  Thanks again!

Hi @Jillian Menoche  I have tested the same script on my machine. It's working fine, not giving any error message. You have to insert this in Scripted Post function. 

 

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.security.roles.ProjectRoleManager

// The role you want assignees to set from
final roleName = 'Administrators'

// If it is true, the assigned issues will be reassigned
final reassignedIssues = true

def issueManager = ComponentAccessor.issueManager
def projectRoleManager = ComponentAccessor.getComponent(ProjectRoleManager)

// Get all of the users associated with the specified project role
def projectRole = projectRoleManager.getProjectRole(roleName)

// Sort the users of the project role using the user key
def users = projectRoleManager.getProjectRoleActors(projectRole, issue.projectObject)
.applicationUsers
.toSorted { it.key }

// There are no users in the specific project role
if (!users) {
log.info ("No users for project role $roleName")
return
}

if (!reassignedIssues && issue.assignee) {
log.info ('The issue is already assigned')
return
}

// Find the latest created issue id that has an assignee
def lastIssueIdWithAssignee = issueManager.getIssueIdsForProject(issue.projectObject.id)
.sort()
.reverse()
.find { issueManager.getIssueObject(it).assignee }

if (!lastIssueIdWithAssignee) {
issue.setAssignee(users.first())
return
}

def lastAssignee = issueManager.getIssueObject(lastIssueIdWithAssignee).assignee
def lastAssigneeIndex = users.indexOf(lastAssignee)
def nextAssignee = users[(lastAssigneeIndex + 1) % users.size()]

issue.setAssignee(nextAssignee)

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira Service Management

JSM June Challenge #2: Share how your business teams became ITSM rockstars

For JSM June Challenge #2, share how your non-technical teams like HR, legal, marketing, finance, and beyond started using Jira Service Management! Tell us: Did they ask to start using it or...

299 views 9 7
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you