Script Runner 'Create Subtask' post function - How to auto assign subtask to a user or group?

In Jira, we came up with a workflow that requires a ticket to auto-create subtasks on transition, which is no problem with the Script Runner 'Create Subtask' post function. Now, I'm trying to auto-assign the subtasks to a specific user group or individual user in the 'Additional issue actions' box of the create subtask post function. I can't seem to get the subtask to assign to either a user or a group. Any ideas on how to do this?

 

Here is what I'm trying to do to assign a subtask to a specific user:

import com.atlassian.crowd.embedded.api.User
import com.atlassian.jira.component.ComponentAccessor
userManager = ComponentAccessor.getUserManager()
user = userManager.getUserObject("user@company")
issue.setAssignee(user)

 

Also, am I solving this problem correctly? What we have is a list of about 15 subtasks that need to be created when the issue is transitioned to 'start progress', all of which need to be assigned to a specific user or group. If it makes more sense to do this using one groovy script that runs as a post function vs using the create subtask post function, let me know. Also, being pointed in the direction of some documentation on how to do this would be a huge help... I'm pretty new to Jira.

3 answers

1 accepted

Accepted Answer
0 votes

The Bob Swift Create on Transition plugin worked perfectly for this.

0 votes

Hi there!

I don't know if there's a built-in function on Script Runner to do this but, besides that, an easy way to do it is to create a new workflow to be used only with sub-tasks that would have a post-function on the Create transition to assign the issue to a specific user.

There are two knowledge documents that can help you with that:

Configuring Workflow

Configuring workflow schemes

Cheers!

Joao

Ok But How Can I Assing to Group ? Bob Swift Pluging not assing group just spesific assing !!

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Sep 18, 2018 in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

25,580 views 2 7
Join discussion

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you