How to create automation- When x epic link is tagged, then x add component
Asked by Alyssa White:

1. **When an issue is updated**
2. **And If that update is the Epic Link being created**
3. **And if the Parent matches "component in ("test")**
4. **Then Edit Issue add Component value(s) you want**.

I would like to create an automation for when a story is tagged with a certain epic link, then a certain component is automatically added. I know this is close, but the automation still isn't working.

Can anyone give me some guidance on this?

![Capture.PNG](/t5/image/serverpage/image-id/263229i1C43A10B26445EDE/image-size/large?v=v2&px=999 "Capture.PNG")


Answers:
author: Mark Segall
body: Hi [@Alyssa White](/t5/user/viewprofilepage/user-id/5243750) and welcome to the community!

I'd recommend something like this:

* TRIGGER: Field Value Changed (Epic Link)  
  This is less noisy than Issue Updated
* CONDITION: Epic Link Is not Empty
* IF CONDITION (Related Issues Condition)
  * Epic
  * Matches Specified JQL
  *

    ```
    Component IN (Test)
    ```

  * ACTION: Edit Issue Fields (Component)

comments: author: Alyssa White
body: Thanks so much [@Mark Segall](/t5/user/viewprofilepage/user-id/4666637) this works great!!


author: Alyssa White
body: [@Mark Segall](/t5/user/viewprofilepage/user-id/4666637) follow up question- do the components need to have the same name as the epic link I am trying to tag?

For example, I am trying to take this rule across my whole project for different epic links/multiple components-

When a story is tagged with the epic test123, then add components test1 and test345

I guess I'm having a hard time understanding what aspect of the rule is tied to the 'Epic Link' name since in my previous example they both had the name 'test'


author: Mark Segall
body: Not sure I understand. The rule condition is looking at the triggered issue's Epic to validate attached component(s) and if it returns true then applies whatever components you've defined to the trigger issue.


author: Khai Shaun Ng
body: [@Mark Segall](/t5/user/viewprofilepage/user-id/4666637) Is "Epic Link" still an option in the trigger of "Field value changed" for automation in Cloud?

I read somewhere there is an initiative to merge Epic Link and Parent Link into "Parent", but I can only find "Parent Link" in "Field value changed" trigger, and this trigger does not get triggered when Epic link is updated. Is there any way around this?


author: Mark Segall
body: Hi [@Khai Shaun Ng](/t5/user/viewprofilepage/user-id/1723654) - Unfortunately, Epic Link is not an option for Field Value Changed. Instead, you'd need to do something like this to kick off the rule which is going to be a more noisy rule:

* TRIGGER: Issue Updated
* CONDITION: Advanced
  *

    ```
    {{changelog.Epic Link.fromString}}
    Does Not Equal
    {{changelog.Epic Link.toString}}
    ```

As stated, this is noisy, because the rule will trigger every time the issue has any update, but will only proceed if the Epic Link was changed.


author: Khai Shaun Ng
body: [@Mark Segall](/t5/user/viewprofilepage/user-id/4666637) Thanks for the hint, I thought about this too but I think this comes with performance cost.

However, yesterday I tried changing an Epic of tickets with an automation rule using "Parent Link" in "Field Value Changed" trigger, it somehow worked, can you check if it is also the case for you?


author: Mark Segall
body: Ooh! Very interesting. Confirmed this works for me as well and I tested in a Free environment to prove out that this is not only available to Premium.

I love it when I learn new things here. Thanks for sharing! This is so much more efficient.


Tags: jira

cloud

jira-cloud