Assign to last role member, or to a specific user based on a condition.

Steve Beauchamp August 13, 2020

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?

3 answers

1 accepted

0 votes
Answer accepted
Radhika Vijji _Innovalog_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 13, 2020

Hi Steve,

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.

  1. Add the Assign to last role member post-function
  2. Select the project role as "QA"
  3. Save the 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:

  1. Add the Set field value post-function
  2. Select the field as Assignee
  3. Input the Value as the username of the specific user. For example, jdoe
  4. Select the conditional execution section option
  5. Input the following condition
  6. !issue.get("assignee")
  7. Save the post-function
  8. Place the post-function after the first post-function
  9. Publish the workflow and test

Regards,

Radhika

David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 13, 2020

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.

Like Rosa M Fossi likes this
Steve Beauchamp August 13, 2020

This worked! Thanks @David Fischer 

1 vote
Rosa M Fossi February 12, 2021

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):

  • Created a custom user picker field called "Tier 2 Assignee" and set its context / configuration to use the users listed in Project Role: Tier 2 CRM.
  • Added the newly created custom field to my relevant create/edit screens, but then HID THEM from the agent view. For all intents and purposes, this is a hidden field for all my users.
  • Reconfigured my existing automation in two ways:
    • Edited the initial IF statement to first check "if Tier 2 Assignee is NOT empty", Assign the issue to the user listed in that field.
      • when this condition fails, it moves onto the Else-if statement.
    • The Else-if statement basically mirrors what I used to have in the automation but with an added a re-fetch component after automation does the round-robin assignment, immediately followed by an Edit Issue component that copies the Assignee into the Tier 2 Assignee field.

 

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). 

check-custom-field-then-round-robin.png

 

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. 

0 votes
Amanda Kirk
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 13, 2020

@Steve Beauchamp 

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: 

https://docs.atlassian.com/software/jira/docs/api/7.0.5/overview-summary.html

Steve Beauchamp August 13, 2020

Thanks Amanda! 

I was hoping to find a solution that wouldn't require me to buy yet another add-on. 

I will dig into the custom script options for the time being. 

Any other suggestions (ideally using JMWE/groovy) are most welcome! :)

Amanda Kirk
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 14, 2020

Ah, didn't realize you already had JMWE which does provide this functionality! Looks like you found your solution. Good luck with the implementation!

Like Steve Beauchamp likes this

Suggest an answer

Log in or Sign up to answer