Can't create and sync sub-task from Jira Cloud to Jira Server

Originally asked by Support on 22 December 2022 (original question)


Hello Support,

I’m trying to sync issue with sub-task from my cloud env. to my on-prem env.

I followed your documentation but still getting error message (using script mode).

The sync of the parent task is working as expected by another connection.

Caused by: javax.script.ScriptException: javax.script.ScriptException: com.exalate.api.exception.IssueTrackerException: Subtask cannot be created: parent issue with remote ID 11911 was not found. Please make sure the parent issue is synchronized before resolving this error.

Incoming script in Jira data center

if(firstSync && replica.parentId){
    issue.typeName     = "Decision" //Make sure to use the right subtask type here.
    def localParent = nodeHelper.getLocalIssueFromRemoteId(replica.parentId.toLong())
    if(localParent){
        issue.parentId = localParent.id
    } else {
       throw new com.exalate.api.exception.IssueTrackerException("Subtask cannot be created: parent issue with remote id " + replica.parentId + " was not found. Please make sure the parent issue is synchronized before resolving this error" )
    }
}



Comments:

Support commented on 22 December 2022

Hi,

In order to sync the parent link with a subtask, you need to first sync a parent task, and then only the related subtasks. So if you sync subtasks before the parent task, you will get an error, may you please make sure the parent issue is synchronized first?

Best regards.

David Antebi commented on 24 December 2022

Hi Support,

I double checked, the parent task was already synced to the destination server.

Thanks,

David

Support commented on 26 December 2022

Hi,

Please make sure you do this in the below order:

1-Un-Exalate the subtask

2-Make sure the parent is synchronized

3- Synchronize the subtask.

Feel free to contact us back for further questions.

Kind regards.

David Antebi commented on 27 December 2022

Hi Support,

I did that several times and it didn’t help.

I also tried to create a new parent task → sync it → then created a new sub-task. That didn’t work as well.

Thanks,
David

Support commented on 27 December 2022

Hi,

Is there any error message after you tried?

Best regards.

David Antebi commented on 28 December 2022

Hi Support,

I received the exact error message as before
Caused by: javax.script.ScriptException: javax.script.ScriptException: com.exalate.api.exception.IssueTrackerException: Subtask cannot be created: parent issue with remote ID``11911 was not found. Please make sure the parent issue is``synchronized before resolving``this error.