I want to create a post-function that will assign an issue to the last member from in the Quality Assurance role that it was assigned to. However, if nobody in that role had the issue before, I want to assign it to a specific user.
e.g. Bob (Developer) creates a bug. He transitions it, which should assign it to the last QA role member that had it, but nobody in QA was ever assigned to the issue, so the issue should transition to Sally.
Any ideas on how I can achieve this?
You can implement the first part of the requirement (to assign to the user to the last member of QA) using the Assign to last role member post-function.
For the second part of the requirement (to assign to a specific person if not assigned by the first post-function), add a Set field value post-function after the above post-function to set the assignee:
Actually, the solution is the opposite: first assign the issue to Sally, and then assign it to the last role member, because the Assign to Last Role Member post-function will leave the Assignee field untouched if there is no member of the role was previously assigned to the issue. No conditional execution needed.
You can script a custom solution by utilizing the ChangeHistoryManager to check the list of all previous assignees and cross check that with the members of the role.
This would be pretty involved, so you may also want to check out Automation for Jira's simple but smart auto-assignment options: https://blog.codebarrel.io/smart-assign-jira-issues-load-balancing-round-robin-and-more-530f3a48bb25
We utilize these heavily for various clients to avoid re-inventing the wheel.
If you do decide to go the custom script route, JIRA API reference is your best friend:
I know this issue is a couple of months old now, but since I landed on this thread due to looking for a solution to a similar scenario, I wanted to share how I ended up resolving.
Some background: In our Service Desk, we currently have an automation to auto-assign tickets that transition into "Tier 2" status in a round-robin style to users part of "Tier 2 CRM" project role.
The problem: If the ticket transitioned away from Tier 2 status and for whatever reason re-transitioned into Tier 2, a new agent was likely assigned (and ended up having to dig up history and re-assign to the initial agent).
The easiest solution to implement (for me):
Here is a sample (note: I have an additional condition in the Else-if statement that matches to a component, but that is not necessary. It's just something we use since we have a couple of Tier 2 teams; a single "else" would satisfy as well).
Final note: This automation is not retroactive. So issues that have flowed through Tier 2 already and may transition back to Tier 2 will still run into the wrong assignee issue (including having the wrong Tier 2 agent assigned to it in the hidden field). There might be a way to bulk update this, but in truth, I haven't looked into it. My agents know that this will happen for tickets prior to today and they're ok with that. It will normalize within a couple of weeks.
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