Subtask parent ID is not syncing

Originally asked by Sam on 12 April 2021 (original question)


Hello everyone,

We have two on premises JJIRA servers installed, I followed Exalate documents for synchronizing subtask, but it doesn’t seem to work as subtasks are synced with no parent ID synced although parents issues are synced first.

How to sync tasks and subtasks in Jira on-premise - Exalate Documentation - Exalate Documentation (idalko.com)

Outgoing:

replica.parentId = issue.parentId

Incoming:

if(firstSync && replica.parentId){

issue.typeName     \= "Sub\-task" //Make sure to use the right subtask type here.

def localParent \= nodeHelper.getLocalIssueFromRemoteId(replica.parentId.toLong())

if(localParent){

    issue.parentId \= [localParent.id](http://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" )

}

}

Thanks


Comments:

Charlie Schonken commented on 14 April 2021

Having exactly the same issue.
I am syncing from Azure DevOPS to JIRA Cloud, but exactly the same outgoing and incoming code samples.

In JIRA the Sub-task is created, but not linked to any parent.

The issue seems to be related to the localParent variable, which seems to be empty regardless of attempting to fetch it from getLocalIssueFromRemoteId node helper.

HELP

Charlie Schonken commented on 14 April 2021

seems JIRA cloud does not support the getLocalIssueFromRemoteId method

https://docs.idalko.com/exalate/display/ED/nodeHelper

instead it lists getLocalIssueFromRemoteUrn

Sam commented on 15 April 2021

Hi Charlie,

in my case I have two JIRA servers and I ended using external script to make it work

Charlie Schonken commented on 15 April 2021

For the license we paying, I expect the product to do what it says though.
No point using yet another point of failure to achieve this.

Support Exalate user any advice?

Daniel Carvajal commented on 16 April 2021

Hi Charlie

We’re sorry to hear you’re struggling with this configuration, could you provide us you Exalate version and Jira server version so we can have a better perspective on this issue?

Kind regards,

Daniel

Charlie Schonken commented on 16 April 2021

Daniel Carvajal
We are on JIRA cloud (not server), so whatever the latest cloud version is

Similarly, Exalate will then be latest (Version:4.1.7-AC)

Charlie Schonken commented on 19 April 2021

Any feedback Daniel Carvajal?

Daniel Carvajal commented on 20 April 2021

Hi Charlie Schonken

Thanks for the information, just to verify are you using the epic send/receive methods as well?

Kind regards,

Daniel

Charlie Schonken commented on 20 April 2021

Not sure what the epic send/receive methods are, pls enlighten me Daniel Carvajal

Presently we are syncing the User Story from DevOPS to JIRA Cloud

In DevOPS the user will then load Tasks, where the User Story is the parent

It is those Tasks I am trying to sync to JIRA Cloud now.

As previously stated, the incoming script does show the correct parent ID for the user story, however, it is not linking it in JIRA

Charlie Schonken commented on 22 April 2021

Daniel Carvajal, Support any advice?

Daniel Carvajal commented on 28 April 2021

Hi Charlie Schonken

Since these are different environments the solution provided to Sam will not apply to your case, our customer success specialist Saskia will reach out to you since we believe you can benefit the most from a workshop.

Kind regards,

Daniel

Charlie Schonken commented on 29 April 2021

She has, thank you

Answer by Daniel Carvajal on 15 April 2021

Hi Charlie

Could you try changing the localParent definition from:

def localParent = nodeHelper.getLocalIssueFromRemoteUrn(replica.parentId)

to:

def localParent = nodeHelper.getLocalIssueFromRemoteId(replica.parentId.toLong())

Kind regards,

Daniel


Comments:

Charlie Schonken commented on 14 April 2021

I adjusted my incoming sync

       if(firstSync && replica.parentId){
          issue.typeName     = "Sub-task" //Make sure to use the right subtask type here.
          def localParent = nodeHelper.getLocalIssueFromRemoteUrn(replica.parentId)
          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" )
          }
       }

I can see the issue.parentId is now being populated by the CORRECT Id for the parent, however, the sub-task being created still is not linked to any parent.

Only thing that looks odd maybe … the key its populating is numeric (95407), which technically is correct, but should it not be the actual key (alpha-numeric)?

Unable to resolve this. Help.

Charlie Schonken commented on 15 April 2021

Hi Daniel,

I have tried both … with the same result.
In both cases the subtask is created, but it is not linked to a parent, which effectively breaks the ticket.

Harold Oconitrillo commented on 09 May 2022

Hi Charlie,

Please make sure that parent ticket is Exalated already, if the subtasks are Exalated before the parent, the relation won’t be maintained.

Feel free to contact us back for further questions.

Kind regards,

Harold Cruz