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

Can I copy a field value from sub-task to the parent issue

James Porter Jan 21, 2014

Hi,

I am looking for a method to update a parent issue custom field with data from a sub-task when I transition a sub-task. (perhaps some post-function?)

Each of our issues will have one sub-task that will be assigned to a different user from the owner of the parent issue.

Part of our workflow requires the owner of the sub-task to input some text into a custom field. When the sub-task is closed I would like to copy that text to a custom field on the parent issue.

(for reporting purposes - we only look at the parent issue, but want to see this text update captured on the sub-task)

I hope this makes sense and any suggestions are welcomed

thanks

5 answers

1 accepted

2 votes
Answer accepted
Peter Van de Voorde Jan 21, 2014

Hi James,

The JIRA Misc Workflow Extensions plugin has the post function you need :

https://marketplace.atlassian.com/plugins/com.innovalog.jmwe.jira-misc-workflow-extensions

Best regards,

Peter

James Porter Jan 28, 2014

Thanks Peter. No way of doing this without adding a paid-for addon?

1 vote
Cori Drew Jul 05, 2017

These are all paid extensions. Are there any plans to add a post-build step to copy a field value to parent?

0 votes
Andreas Knecht 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:

edit-sub-tasks.png

(this example updates the description, in a sub-task when the parent changes, but you could reverse this too so a sub-task update, updates the parent)

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

0 votes
Lukas Gotter Dec 13, 2016

Another option is the newest version of the plugin Workflow Essentials for JIRA.

It contains a post function to copy values from sub-task to parent (and vice versa if you need that).

0 votes
Jira Merch Admin I'm New Here Wednesday

Run a script as postfunction on the tansition to Done on the subtask. 

 

def parentKey = issue.fields.parent.key
def issueKey = issue.key
def tradeTermsKey

def parent = get("/rest/api/2/issue/" + parentKey)
.header('Content-Type', 'application/json')
.asObject(Map).body

def parentUpdate = put('/rest/api/2/issue/' + parentKey)
.header('Content-type', 'application/json')
.body([
fields: [
customfield_11901: issue.fields.customfield_11901, // Customer updated from number field to text field
customfield_11900: issue.fields.customfield_11900 // Vendor updated from number field to text field
]
])
.asString()

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Jira

Try Jira Cloud for Outlook: Organize your work without leaving your inbox

Hi Atlassian community, My name is Max and I work on the product integration team at Atlassian. I am pleased to announce the early access program for the Jira Cloud add-in for Outlook. This add-in...

783 views 0 12
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