Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to copy a subtask custom field value from the subtask to it's Parent (same custom field).

Tanwa Arewa
Contributor
September 14, 2021

I have seen many solutions for copying a Parent custom field value to a subtask custom field, but not the other way round.

Can someone help please?  Is it possible via ScriptRunner or something else, to copy the value of a subtask custom field after transitioning to Done, to the Parent custom field of the same field?  Would a post function script do it or another?  What would the script look like?

Background
The custom field value is first entered into the subtask after the work is done.  We need this value copied to the parent before 15 other subtasks are completed for the same Parent issue.

Please advise of a solution.  Thank You in Advance.

2 answers

1 vote
Darryl Lee
Community Champion
September 14, 2021

Hi - it looks like this can be done with ScriptRunner, based on the conversations here:

https://community.atlassian.com/t5/Adaptavist-questions/Scriptrunner-listener-copy-field-value-from-subtask-to-parent/qaq-p/944523

Tanwa Arewa
Contributor
September 14, 2021

 Thank you for the prompt response. Will try now 

 

0 votes
Ravi Sagar _Sparxsys_
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.
September 14, 2021

Hi @Tanwa Arewa 

Yes, ScriptRunner can definitely be used to do this. The examples you saw to copy from parent to subtask will not be a lot different for doing the reverse.

You can retrieve parent issue object using by something like this.

issue.getParentObject()

Where "issue" is an object.

To copy value from sub task to parent you can use a listener or may be a script post-function. You would use a script post-function if you need to perform some actions in specific order. Listener responds to event.

Ravi

Tanwa Arewa
Contributor
September 14, 2021

@Ravi Sagar _Sparxsys_ Thank You will try it.

Suggest an answer

Log in or Sign up to answer