inherit the value of the 'account' field from the epic and put it in each task of the epic
Asked by KALOS:

In a Jira project, I have associated several Tempo Timesheets accounts. I would like to make sure with automation for jira, that when I create an epic and associate the epic with one of the accounts, let's say Account1, all the tasks I create within that epic will then take the value of the account field of the 'mother' epic. Have any of you faced and solved this problem? At the moment I can't and so I have to make a rule for each epic ... in the project. Specifying the account code by hand.

![Screenshot 2024-08-07 alle 13.50.34.png](/t5/image/serverpage/image-id/340502iC3C19C25A1D51300/image-size/large?v=v2&px=999 "Screenshot 2024-08-07 alle 13.50.34.png")![Screenshot 2024-08-07 alle 13.50.43.png](/t5/image/serverpage/image-id/340501i863A45310CDF8CD7/image-size/large?v=v2&px=999 "Screenshot 2024-08-07 alle 13.50.43.png")


Answers:
author: Dick
body: Hi Kalos,

You would end up with two automations:

**First one:**

The start of your automation should follow your problem description:

when: Field Account changes on an issue

And the issue is an Epic

Branch for all issues in Epic

Then edit issue field Account = value copy from epic

**Second one:**

If the epic is already there and an issue is linked to the epic:

When: value changes for parent link

and issuetype in (story, bug, etc)

and parent link is not empty

edit issue fields Account = copy from parent

comments: author: Dick
body: to be neat: you would require the reciprocals as well (might be able to build them into one and two).

**Third one:**

if an epic looses the field account the attached issues should be loosing the field content as well.

**Fourth one:**

If an issue is taken from an epic it should loose the corresponding value for Account.

Life is never easy, building automations as well...

:)


author: KALOS
body: the third case in my management process, is not covered. While the fourth is interesting, of course. But for now I'm 'stranded' in understanding: how do you tell automation for jira to 'read' the account field in the epic and pass it to the linked task?


author: KALOS
body: ok [@Dick](/t5/user/viewprofilepage/user-id/4586768) I did not see your suggestion point two properly. So I have to do that? and how do I say 'take the account field then'?

![Screenshot 2024-08-08 alle 06.35.45.png](https://community.atlassian.com/t5/image/serverpage/image-id/340650i387732E694A9E98F/image-size/large?v=v2&px=999 "Screenshot 2024-08-08 alle 06.35.45.png")


author: Jack Brickey
body: Hi [@KALOS](/t5/user/viewprofilepage/user-id/5479877) , welcome to the community.

Could you please share the audit log associated with the rule triggering? Another thing that you're going to need to consider here, after we get the basics working, is that an issue could be added to the epic after it has been created so I think you're gonna wanna trigger on the issue being updated and the Parent feel being set. Likely a separate rule.


author: KALOS
body: Reflecting on the suggestions you have given me I finally solved it this way, for now I am only fine with handling the case of the newly created task under the already existing epic. Thank you both.

![Screenshot 2024-08-08 alle 06.44.22.png](https://community.atlassian.com/t5/image/serverpage/image-id/340651i8DDE7945DDA87F37/image-size/large?v=v2&px=999 "Screenshot 2024-08-08 alle 06.44.22.png")


author: KALOS
body: [@Dick](/t5/user/viewprofilepage/user-id/4586768) [@Jack Brickey](/t5/user/viewprofilepage/user-id/853369) Yes, you are right, I am only examining one case so far. But let's look at this case: I already have an existing epic which already has the 'account' field valorised. And I want to create many tasks in the epic. How do I set up an automation rule that 'understands' what the epic is and copies the 'account' field from the epic to the task I'm creating? Then maybe from some examples you can give me, I'll try to make rules for the other cases too. For Jack, I didn't understand what you need the audit log for.

comments: author: Dick
body: Hi Kalos,

Thank you for accepting my answer / way of thinking. Be sure to turn the automation off when you're done creating the tasks under your epic, as you're running the automation for each issue created (also when it isn't attached to your epic).

Your last question is answered in script two.  

Happy automating!

Dick


Tags: automation

data-center

jira-data-center

tempo-timesheets