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

Zachary Levey December 18, 2012

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
Natalie Hobson
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 4, 2013

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

Natalie Hobson
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 4, 2013

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

Zachary Levey January 4, 2013

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.

Natalie Hobson
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 4, 2013

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. :)

0 votes
andreas
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 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

0 votes
Zachary Levey January 4, 2013

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
Natalie Hobson
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 4, 2013

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?

0 votes
Zachary Levey January 2, 2013

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.

0 votes
Natalie Hobson
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 21, 2012

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)?

0 votes
dleng
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 20, 2012

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.

Zachary Levey January 2, 2013

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

Joel Holmberg August 28, 2013

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
Linson Ittoop February 28, 2020

This works. Thank you @Joel Holmberg1

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events