Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to automatically assign a user to a subtask

How do I automatically assign a user to an existing subtask?

1 comment

Hi @Angela DiCesare

By default, your sub tasks will be assigned to the component lead. If one of your sub tasks should go to a different user, you can hard code this change in the post function.

NOTE: This solution utilizes script runner add-on to hard code the assignee to the sub task.

  1. Go to your project
  2. Click Project Settings
  3. Click Workflow
  4. Edit your workflow
  5. Choose diagram
  6. Click the first transition (create), then click Post Functions
  7. Click Script Post-Funciton [ScriptRunner]
  8. Create sub task
  9. Condition = the script for identifying the component:

    import com.atlassian.jira.bc.project.component.ProjectComponent
    import com.atlassian.jira.component.ComponentAccessor

    for(ProjectComponent projectComponent: issue.getComponentObjects()){
    if(projectComponent.getName().equals("COMPONENT NAME"))
    return true
    return false

  10. Target Issue Type = Sub-task
  11. Sub Task Summary = What the sub task will be called
  12. Additional issue actions field:

    issue.assigneeId = "TYPE USER NAME HERE"

  13. Click Update
  14. Publish the workflow changes

Hope this helps or at least gets you past 1 hurdle!

- Jonathan

Like # people like this

Hi, I would like to do the same automatic assignment but I can't find the "Additional issue action" field on the "Post function" list.

Can you give me any suggestions?



@Carlo Anapoli 

   I updated the response above.

My setup is to generate a sub task based on selection of a component. The sub task will then auto assign to whoever we hard code in step 12.

It is messy but it works.

- Jonathan

Like Carlo Anapoli likes this


Log in or Sign up to comment
Community showcase
Published in Jira Software

👋 Looking for 15-20 volunteers to test Atlassian training content

Hi everyone! Are you interested in beta testing Atlassian University’s newest (unreleased!) training course? We’re looking for 15-20 volunteers to test our newest training course, Basic reporting...

686 views 23 26
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you