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

Sub-tasks not inheriting fields from parent when using "Set Field Value From Parent Function".

Hey All,

I'm trying to create a workflow scheme where any new sub-tasks inherit "Component/s", "Fix Version/s" and a custom field from the parent issue. Unfortunately, it's not working. Whenever I attempt to create a sub-task, the fields are still blank. I've ensured that it's on the "Create" transition, but that the post-functions occur AFTER the "Create Initially" step.

JIRA: 5.2.1

JMWE: 2.5.4

GH: 6.0.8

Thanks!

7 answers

1 accepted

0 votes
Answer accepted

Move the post function to be before "Creates the issue initially". :)

Thanks for the karma Zack, and glad I could help! :D

this works, but does overwrite whatever is included in the field when the user is filling out the field. Thanks! I'm seeing the changes propagate now.

Ah yes, that is a drawback (overwriting). I think I remember seeing someone request functionality from the plugin developer to include an "only if field is not already assigned a value" option to prevent overwriting, but I haven't looked into that for a couple months. :)

Hello Zack L,

Are you using a separate workflow for the "Subtask" issue type? I think you need 2 different workflows, 1 for bug/task/improvement etc and another one for Subtasks. Then for the subtasks workflow create transition, just add the post function Set field value from parent.

Hey Daniel,

Yes I am. I've got a sub-task workflow along with a couple of other workflows assembled into my workflow scheme. I've specifically assigned sub-tasks to that workflow and double-checked that part of the config. I'm using the post-function you've listed, and the behavior is not working as listed.

Thanks,
Zack

A few things I've noticed that might help others:

* You do NOT need separate workflows for sub-types. Using only one workflow means that any non-sub-typ issue will try inheriting values from it's parent, but since it doesn't have one, nothing will happen, and it will use the values entered on creation.

* System Fields (like Component/s) need to be inherited BEFORE the "create initially" step

* Custom Fields can be placed AFTER the "create initially" step.

* You can have a field mandatory in parent issues and let it be inherited to sub-tasks and make the field optional in the subtask field configuration, then remove the field from the sub task create screen, that way user cannot enter a value only to see it being over-written by the inheritance function. Then make the field visible and mandatory in the edit screen, so that you can change the value in the sub-task later if you need to, still forcing the field to have a value.

Hope it helps!

Joel

Like # people like this

This works. Thank you @Joel Holmberg1

I was looking to Inherit the System fields to sub task, and this is a good solution.

Are you saying the fields are blank on the create screen, or still blank after issue creation?

Exactly where in the list of post functions did you add it (you said after create initially, but what about its location in regards to the re-index function)?

To clarify, I'm saying it's still blank after the issue creation. Right now, I've got it set up like:

Create Initially
Set field value from Parent (Component)
Set field value from Parent (Fix Version/s)
Set field value from Parent (Dev Team)
Re-index the issue (I've tried with and without this)
Fire "Issue Created" event.

I leave the fields empty, and hit the "Create" button. After hitting that create button, the sub-task is created, but the fields remain empty.

I just tested this out, and I was able to get the post function to work when I placed it *before* "Creates the issue originally". Maybe try moving it in the list and see if that does the trick?

Nat - if you post this as an answer, I'll choose yours as the correct one. This worked like a charm. I did it after the "create originally" because of an issue I'd seen with doing this previously. Thanks!

0 votes
andreas Community Leader 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)

For more details see https://blog.codebarrel.io/synchronize-parent-and-sub-task-issues-with-automation-for-jira-bdcca6c9d453

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Marketplace Apps & Integrations

Cloud Cafe Ep. 4: Listing your app on the Atlassian Marketplace

Hey y’all! Grab a cup of ☕ and check out the latest installment of Cloud Cafe – our video series about cloud app development on Atlassian. If you’re new to Cloud Cafe, check out the first few episo...

116 views 0 2
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