post function to set subtask fields from parent on create

I'm trying to do something that is well documented but for some reason it's not working for me....

I would like to default some custom fields when creating a subtask from the parent (from the JIRA UI) to values from the parent.

I have created the following post functions on the create issue transition. But the fields are not pre-populated with defaults from the parent when the 'create subtask' page is displayed.

  1. The value(s) of field Platform(s) will be set from the issue's parent (replacing existing values).
  2. The value(s) of field Application will be set from the issue's parent (replacing existing values).
  3. Creates the issue originally.
  4. Fire a Issue Created event that can be processed by the listeners.

What am I missing?

3 answers

1 accepted

0 votes
Accepted answer

I thought that was the case but after reading this it made me think that somehow it was executed before the create screen was displayed.

Is there any way to default a custom field on the subtask from the parent when the create screen is initially displayed? In fact, I really don't even want to show the custom field on the subtask but if I hide it I run into the problem in that the subtask rows are not returned in the JQL results.

Any help would be appreciated

Sorry for the late reply. I didn't recieve a mail about your answer. What you can do is to remove the fields from the subtask create screen. Use your postfunction as before. So once a subtask is created the fields are inherited from the parent. Don't hide the fields, simply don't put them on the view, create or edit screen of your subtask. You will be able to query them. Hope that helps.

That did the trick. Thanks very much! Note that I also opened this issue but I think that your solution may help others who want to set the field value on the subtask as opposed to providing a visible default. thanks again Ron

Well, the postfunctions will run only when you hit the create button on the create screen of your subtask. That's why the fields are not populated on the create screen.

0 votes
Andreas Knecht Community Champion Nov 21, 2016

There's now a very easy to configure way to keep fields for parents and sub-tasks in sync using Automation for JIRA!

You can easily modify related issues (such as parents, stories, sub-tasks, epics, linked issues and even JQL) using our related issues action and condition:

(this example updates the description, but pretty much any field can be edited including custom fields)

For more details see

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 27, 2018 in Portfolio for Jira

Introducing a new planning experience in Portfolio for Jira (Server/DC)

In the past, Portfolio for Jira required a high degree of detail–foresight that was unrealistic for many businesses to   have–in   order to produce a reliable long-term roadmap. We're tur...

2,799 views 18 22
Read article

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