automatic rule for sub-task to inherit a custom date field from its parent
Asked by Martina Hurte??kov?:

Hello,

I?m new in automatic rules in Jira cloud and I tried to google for solution to my problem but haven?t found it.

We want the sub-tasks to inherit a custom field "Deployment Prod" (it?s a date field). this field can be filled in in the parent at any time (no status or transition specified).

I tried several ways but none of them is working. please see attached my 3 attempts and assist me on setting it up. thanks a lot, Martina

![attempt3.png](/t5/image/serverpage/image-id/335804i99AC012E426BE3B2/image-size/large?v=v2&px=999 "attempt3.png")![attempt2.png](/t5/image/serverpage/image-id/335806i7213BBB6285A32A0/image-size/large?v=v2&px=999 "attempt2.png")![attempt1.PNG](/t5/image/serverpage/image-id/335805i87CE5FE6EF7EAA86/image-size/large?v=v2&px=999 "attempt1.PNG")


Answers:
author: Bill Sheboy
body: Hi [@Martina Hurte??kov?](/t5/user/viewprofilepage/user-id/5359641)

How accurately do you need the field in the subtasks to be, regarding a match to the parent issue?

That will determine how many automation rules you need, and which triggers they use. For example, you could have at least this many rules:

1. when a subtask is created, copy the field from the parent issue
2. when a subtask is edited to manually alter the field, set the value back to the parent's value
3. when a subtask changes its parent, copy the field from the new parent issue
4. when a parent issue changes the field, update the value in any subtasks
5. when a subtask is converted to another issue type, what should happen to the field value?
6. etc.

Kind regards,  
Bill

comments: author: Martina Hurte??kov?
body: Hello,

sorry to come later to you.

Do I understand you correctly that instead of 1 rule I need so many?

I reviewed those provided by you and we need the first 4 rules (1.-4.). But I realized it should not be for field Due date but for a custom field called "Deployment Prod" (Type: date time picker). Could you please support me on the steps for creation of the rules?

thanks a lot


author: Bill Sheboy
body: First, please stay engaged with the help [@Tessa Tuteleers](/t5/user/viewprofilepage/user-id/24152) is providing so you get one rule working correctly.

Then, after you have decided the scenarios needed, you can copy that rule and adjust the triggers / conditions, as needed. For example with the Issue Created scenario...

* trigger: issue created
* action: re-fetch issue
* *...previously identified conditions and actions to update your field*


author: Tessa Tuteleers
body: Hey [@Martina Hurte??kov?](/t5/user/viewprofilepage/user-id/5359641) ,

In all cases, your condition speaks of the parent issue. You assume that you would start the rule from the subtask itself. But the trigger here would be the parent, not the subtasks (as the change in the field happens on the parent.

Meaning -\> If you change the duedate of the parent issue, start the rule with the parent and and then copy that date to all subtasks.

Your condition should be on the issue itself, not its parent.

It looks like your first screenshot is the closest attempt

1. When the field of an issue is changed -\> correct
2. Check if the issue is the right issuetype -\> not correct: unteraufgabe is the subtask I'm assuming? You are going to trigger this rule and allow it when you change a duedate on a subtasks, and then copy that field to its subtasks (which do not exist)
3. Check if the field is not empty -\> not correct: this needs to be on the issue itself, not the parent
4. For subtasks: copy date field from issue -\> I don't know how you configured that one, please provide a screenshot if the above does not work.

Hope this helps!

- Tessa

comments: author: Martina Hurte??kov?
body: Hello [@Tessa Tuteleers](/t5/user/viewprofilepage/user-id/24152) ,

thank you for trying to help me but I wasn?t successful in solution.

first of all I need the rule(s) to be created for another custom field called "Deployment Prod" (Type: Date time picker). and I changed the rule as follows:

![deploymentprod.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/339423iE2490830059959C0/image-size/large?v=v2&px=999 "deploymentprod.PNG")

Aufgabe= Task.

and Audit log shows success. however in the tickets it?s not performed.

* Task is 8245
* Sub-Task is 8246

![auditlog.png](https://community.atlassian.com/t5/image/serverpage/image-id/339425iBB324C695FB51694/image-size/large?v=v2&px=999 "auditlog.png")

I will be grateful for any kind of support, how the rule needs to be set up, to ensure that the "Deployment Prod" field in every sub-task is filled in based on its parent issue (Epic, Task, or Story), doesn?t matter if by creation or edition.

Thank you, Martina


author: Tessa Tuteleers
body: Hey [@Martina Hurte??kov?](/t5/user/viewprofilepage/user-id/5359641) ,

please use the following format for your smartvalue:

```
{{triggerIssue.Deployment Prod}}
```

You need to use the actual name, OR the ID in the following format (you get the ID for the field when editting the actual custom field)

```
{{triggerIssue.customField_fieldId}}
```

The action is succesfull because you do add something to the field. only the smartvalue you are using doesn't exist so it returns an empty value.

Please let me know if that works.

-Tessa


author: Martina Hurte??kov?
body: [@Tessa Tuteleers](/t5/user/viewprofilepage/user-id/24152) - yes it works! my smartvalue was wrong. thanks a lot


author: Tessa Tuteleers
body: Good to hear [@Martina Hurte??kov?](/t5/user/viewprofilepage/user-id/5359641)

Thanks for letting me know it worked ??

Please accept my answer, that way other users can find the answer faster if they have the same question.

Have a great weekend!

- Tessa


Tags: cloud

jira-cloud