trying to create an automation to create a subtask and assign to specific user

issue created => issuetype = separation => create subtask assigned to manager

1) how do i assign it to a specific user from a field (like %supervisor%) - that doesn't work
2) it won't save

3 answers

This widget could not be displayed.

Sub-tasks and assignment cannot be dome through the SD automation, these tasks will need to be completed as post functions of your workflow. (Can be a post function of create if you like)

For the assignee, you would want to use the "Copy Value From Other Field" post function to copy your supervisor field to assignee.

image2016-12-9 9:28:22.png

We are doing the subtasks using scriptrunner like this:

image2016-12-9 9:27:50.png

issue.summary = 'Badge Access - ' + issue.getSummary()
import com.atlassian.jira.ComponentManager
import com.atlassian.jira.issue.customfields.manager.OptionsManager
import com.atlassian.jira.component.ComponentAccessor
def componentManager = ComponentManager.instance
def optionsManager = componentManager.getComponentInstanceOfType(OptionsManager.class)
def cf = customFieldManager.getCustomFieldObjects(issue).find {it.name == 'Support Category'}
def fieldConfig = cf.getRelevantConfig(issue)
def optionOrigin = optionsManager.getOptions(fieldConfig).find {it.value == "Technical Support"}
issue.setCustomFieldValue(cf, optionOrigin)
def projectComponentManager = ComponentAccessor.getProjectComponentManager()
def project = issue.getProjectObject()
def component = projectComponentManager.findByComponentName(project.getId(), "Door Access")
issue.setComponent([component])


This widget could not be displayed.

Are you trying to do this in SD's automation or with Scriptrunner?

This widget could not be displayed.

Thanks Jeff, no, i found Quick subtasks for Jira, which works like a charm! 

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 Teamwork

What teamwork quotes inspire you?

Hey everyone! My name is Natalie and I'm an editor of the Atlassian Blog and I've got a question for you: What's your favorite quote about teamwork?  We've compiled a list here, along with...

150 views 16 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