Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Update cuatom field of parent task when values of same cuatom field in its subtask are updated

rahuldanwade
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 26, 2015

Hello all my requirements are as below

I have two custom fields say in a parent task (for the time being consider type of these fields to be Text field )

1.fieldA

2.fieldB

All sub-tasks which will be produced from this task will be having same custom fields.

Now whenever any one of above fields from any of the sub-task value is added it should also update same value in parent task field as well.

for e.g. :-

Parent issue has 3 subtask

if I add value to fieldA in subtask-1 ,subtask-2, subtask-3

it should also be added(all three values from sub-tasks) to parent task's fieldA( text box) with Comma as a separator.   

Is it possible in JIRA

any post function , custom groovy script needed to be written for this.

 

appreciate your support.

 

 

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Phill Fox
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 30, 2015

Hi Rahul,

You are right to assume this would be a scripted action, and it is relatively easy to implement as such.

You would implement the script as a post-function so that whenever the issue is transitioned it would check the following.

  1. Is this a sub-task or a task?
  2. If a sub-task is the value already present in the parent custom field or not?
    If a parent task does the value contain the value from all the sub-tasks? 
  3.  If the value is missing then update the parent task to include it.

The interesting part to the coding is deciding what to do with values that were previously in a sub-task but have since been updated. It is not sufficient to just delete them from the parent as they may apply in another sub-task. So the  approach I would take is to identify the parent issue, then loop over all the sub-tasks updating the values at that point removing the original values before the start of the loop.

I hope this helps clarify your requirements.

Phill

TAGS
AUG Leaders

Atlassian Community Events