script to assign tickets for users in a group with active tickets count is minimum to maximum
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-09-2017 12:47 AM
hi, we have a requirement to run a schedule job everyday at 06 pm and should call a script include which queries all the active tickets in a customized table and assign to the users in a group. the tickets should be automatically assigned in such a way that it should assign to per with least active tickets assigned to him and should continue assigning tickets in incremental order of ticket count of the user.(say out of 20 active tickets with 15 users, first ticket should be assigned to user with 0 active tickets, next 1, 2, 3 active tickets of the user. please help me with the script.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-09-2017 02:02 AM
Hi Krishna,
If the group is fixed, you can query the incident form with the group as one condition and sort on the aggregate for the Assigned_to count. That should give you the person name who have least tickets assigned to him.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-09-2017 02:26 AM
yes the group is fixed and i am able to get user with least count tickets, but the problem is i want to assign tickets with state "Active" to the users in that group. lets say 4 users(with current active tickets already assigned to them is A= 1, B=0, C=1, D=3) and there are 7 tickets for today then first ticket to be assigned to user B, next to user A followed by user C and D who has next increment tickets count. For this requirement i am unable to get script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-09-2017 02:35 AM
Hi Krishna,
Going by your example, you will have to fetch the least count for each ticket. So it will go like this.
1st ticket: Fetch the list ticket user - Result B. Assign the first ticket to him.
New Count A = 1, B = 1, C = 1, D = 3)
2nd ticket : Fetch the list ticket user - Result(Either A, B or C, use the first one which ever comes, lets suppose A comes.) Assign the ticket to A.
New Count A = 2, B = 1, C = 1, D = 3)
3rd Ticket: Fetch the list ticket user - Result(Either B or C, let's suppose B comes.). Assign the ticket to B.
New Count A = 2, B = 2, C = 1, D = 3)
and so on........
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-09-2017 03:22 AM