Create subtask with scriptrunner: setting assignee

I am creating subtask at a workflow postfunction using scriptrunner create subtask postfunction

In my project there is a default assignee and the subtask is getting that instead of the parent s.

How can I force to set the subtask s assignee to that of the parent s?

Thanks in advance.

3 answers

1 accepted

0 votes
Henning Tietgens Community Champion Dec 04, 2013

Are you sure it's not the workflow of the subtask which set the assignee? All fields of the parent are cloned to the subtask including the assignee.

There was a misunderstanding on my part, you are right, the assignee is copied from the parent.

Have you tried adding something like this in your scriptrunner postfunction:

subtask.setAssignee(issue.getAssignee());
subtask.store();

Where subtask is the Issue object of the newly created subtask, and issue is the object of the parent issue.

Have you moved your post function after the Reindex step?

I thought Henning's answer was right when reading but when I checked my post function I set it too. Here is what I have:

issue.assignee == transientVars["issue"].assignee;

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,173 views 13 19
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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot