How can I create a task under one specific Epic

My task is to create a sync between two projects on the same cloud site. If a task is created in the source project the connection should create a task in the destination project under a specific epic (Key: MSC-37).

With the assistance of Aida I tried the following scripts, but nothing worked.

  • replica.customFields."Epic Link" = "MSC-37"

  • replica.customFields."Epic Link".value = "MSC-37"

  • replica.customFields."Epic Link".key = "MSC-37"

  • replica.customFields."Parent" = "MSC-37"

  • replica.customFields."Parent".value = "MSC-37"

  • replica.customFields."Parent".issuekey = "MSC-37"

  • replica."Epic Link" = "MSC-37"

  • replica.parentId = "MSC-37"

  • replica.parentKey = "MSC-37"

I am aware of the changes Atlassian made (replaced Epic Link with the Parent field) but found nothing related to this issue in the documentation. Can you help me solve this problem?

Thank you for your help in advanced!

Bests,

Great question! Associating a newly created task with a specific Epic (like MSC-37) in Jira Cloud can be a bit tricky, especially with Atlassian’s recent changes—moving from the “Epic Link” field to the new “Parent” field for epic relationships.

Here’s how you can do it in Script mode for Jira Cloud-to-Cloud syncs:

1. Use the parent field in the outgoing sync script:

When you want to create a task under a specific Epic, you need to set the parent field to the Epic’s issue key. For Jira Cloud, the correct way is:

replica.parent = "MSC-37"

2. In the incoming sync script:

You’ll want to map the parent field from the replica to the actual issue being created:

if (replica.parent) {
    issue.parent = replica.parent
}

Important notes:

  • This only works for standard issue types that can be children of an Epic (like Story, Task, Bug).
  • The Epic (MSC-37) must exist in the destination project and be accessible.
  • If you’re syncing between different projects, make sure the Epic is in the correct project and the issue type supports being a child of an Epic.

References:

If you follow the above approach and ensure the Epic exists in the destination, your tasks should be created under the specified Epic. No need to use custom fields like “Epic Link” or “Parent” directly—just use the parent field as shown.

Hope this clears things up and gets your sync working as expected!

Hi Roberta,

Following up on the AIDA answer above.

If you want to always sync on the destination side to the same EPIC then you can achieve it from the Incoming sync directly. You will need to get the EPIC ID instead of the key

Incoming sync

if(replica.type.name = "Task"){   
  issue.parentId = "{Insert issue id here}"
}

This code will look if the issue type sent from the source side is a task if yes, then I will add the parentId(which needs to be the ID of MSC-37) as the parent.

Let me know if you have any further questions.

Best,
Kevin