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

This widget could not be displayed.

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

This widget could not be displayed.

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

This widget could not be displayed.

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
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

134 views 2 0
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