Is it possible to update the parent tasks when a child task is added?

Dnyaneshwar Ramesh Borase October 31, 2017

Hello Team,

We are currently making some reports using data extracted from Jira.The extraction works perfectly.

Where the problem comes is when we need to update our currently stored data with either new data or updated existing data.

The problem is that, adding a subtask to an already existing task does not trigger a change to the updated field for the parent task.

Since Jira parent/child relation is only known to the parents we end up with parentless child tasks since the children were found by our search query but the parents weren’t flagged as updated so we don’t update them in our reporting database.

I’d like to ask if it would be possible to update the parent tasks when a child task is added.

If that is not possible, would it be possible to add an hidden field (that is auto populated when adding a task) that shows each children who their parent is?

 

Thanks!

2 answers

1 vote
Anton Chemlev - Toolstrek -
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.
October 31, 2017

You can use ScriptRunner Listener function:

1) Create listener for Issue Created event

2) Check in event if created task is a sub-task.

3) If so, update parent.

Or you can use some other plugins discusses here: https://community.atlassian.com/t5/Jira-questions/Can-I-copy-a-field-value-from-sub-task-to-the-parent-issue/qaq-p/64798

Ronen Erlich August 6, 2019

Screen Shot 2019-08-06 at 11.01.11 AM.pngabove is a screen shot of all the steps 1-3. my problem is that the event available to to update the issue not the parent. Does anyone how I can I update the parent? what I have above just update the subtask I believe...

I have a behavior that sum values from subtasks and show as a field on the parent. currently i need to edit and cancel the parent to get it updated...

thanks,

0 votes
Dnyaneshwar Ramesh Borase November 2, 2017

Thanks for the reply Anton.

Do you have any other suggestion which we could use instead of  any external plugin or third party plugin like Script runner.

Thanks!

Anton Chemlev - Toolstrek -
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 7, 2017

It is a kind of strange and weird solution, but can be developed without custom plugins:

1) Create user and give him some email.

2) Set your notification schemes to send email on Issue Created event to created user.

3) Parse email to  get Issue type from email body

4) If issue type is a sub-task (you should define it yourself) find parent issue and update it with REST API.

OR:

1) Make some web service with one URL. web service not in Jira, you should make it with other instruments

2) Embed webhook into workflow which is used for sub-task creation which will trigger web service

3) being triggered, web service must find parent for this sub-task via REST API and update it.

 

Of course for both solutions you must develop some custom scripts.

Suggest an answer

Log in or Sign up to answer