# Error syncing Sub-task

**URL:** <https://community.exalate.com/t/error-syncing-sub-task/4785>\
**Category:** General Questions\
**Tags:** sync, migrated\_question, sub-task, subtask\
**Created:** [November 4, 2024, 7:23am UTC](https://community.exalate.com/t/error-syncing-sub-task/4785 "2024-11-04T07:23:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![xl8bot](https://dub1.discourse-cdn.com/flex018/user_avatar/community.exalate.com/xl8bot/32/324_2.png) [@xl8bot](https://community.exalate.com/u/xl8bot)\
**Post date:** [November 4, 2024, 7:23am UTC](https://community.exalate.com/t/error-syncing-sub-task/4785/1 "2024-11-04T07:23:50Z")

</div>

_Originally asked by Paolo Bolla on 24 July 2021 [(original question)](https://oldcommunity.exalate.com/questions/30050056)_

* * *

In visual mode, from cloud to cloud instance, when i try to sync subtask i have this error:

`Issue type` with name `Sub-task` is not found. Please select a valid `Issue type`.Check the [documentation](https://docs.idalko.com/exalate/x/_ABzAg) for more details.

The 2 project have same workflow, same issue types and for other issues there’s no problem. No script used.

* * *

---

<div class="post-metadata">

**Author:** ![xl8bot](https://dub1.discourse-cdn.com/flex018/user_avatar/community.exalate.com/xl8bot/32/324_2.png) [@xl8bot](https://community.exalate.com/u/xl8bot)\
**Post date:** [November 4, 2024, 7:23am UTC](https://community.exalate.com/t/error-syncing-sub-task/4785/2 "2024-11-04T07:23:52Z")

</div>

_Answer by Ariel Aguilar on 26 July 2021_

Hi Paolo,

In order to sync Sub-tasks, you need to make sure you to sync the parent task first. So if you sync subtasks before the parent task, you will get an error. Then, the way you have the mapping is fine, the problem here is that you are trying to sync a sub-task and the parent ID information is missing, therefore it throws this error as an “Issue type” error. However, this should not be a problem:

1. Check the following documentation on how to add script: [https://docs.idalko.com/exalate/x/ogXHAw](https://docs.idalko.com/exalate/x/ogXHAw)
2. To add the script, clear the default text from script box and only add the script as follows:

```auto
if (executionInstanceName == "cinetix-group") {
  if (firstSync && replica.parentId) {
      def localParent = syncHelper.getLocalIssueKeyFromRemoteId(replica.parentId.toLong())
    if(localParent){
        issue.parentId = localParent.id
    }
}
}

```

//The connection name in this example is heidix\_to\_cinetix-group.  
3. Make sure to save and publish changes. Make sure to sync the parent task first and then try sub-tasks.  
Let me know if this works for you.  
Kind regards,  
Ariel

* * *

#### Comments:

> **Paolo Bolla commented on 26 July 2021**
>
> > Works! Great!
> 
> All the Sub-tasks was created correctly.
> 
> Thanks Ariel.
> 
> Paolo
