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

mc March 5, 2015

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

0 votes
Answer accepted
mc March 16, 2015

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

0 votes
Alper AYKUT August 18, 2015

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

0 votes
João Palharini
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 9, 2015

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

Suggest an answer

Log in or Sign up to answer