Questions for Confluence license has expired.

Please purchase a new license to continue using Questions for Confluence.

Check if Epic is already synced in the local system

 
1
0
-1
Hello, When trying to sync a story before syncing the Epic, and I get an error. I'm trying to find out how to check if the parent Epic has been synced, and throw an error if it was not. Something like this which was done for Sub-Tasks if (replica.parentId) { def localParent =nodeHelper.getLocalIssueFromRemoteId(replica.parentId.toLong()) if(localParent){ issue.parentId = localParent.id } else { throw new com.exalate.api.exception.IssueTrackerException(issueType + " 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" ) } }
    CommentAdd your comment...

    2 answers

    1.  
      1
      0
      -1

      Hi Francis,


      I did the follow the instructions in the epic sync


      //Outgoing


      //Epic Link
      Epic.sendEpicFirst()
      // Issue link sync
      IssueLinks.send()
      //Task Sync
      SubTask.send()



      //Incoming


      // Move this to the end of the incoming sync script
      SubTask.receive()
      Epic.receive()


      I do understand that we must sync the Epic first then the Story, but I want to print more meaningful message like the one for the sub-task


      here is what I just added, but still do not see the error message 



      if (replica.epicId) {
      def localEpic = nodeHelper.getLocalIssueFromRemoteId(replica.epicId.toLong())
      if(localParent){
      issue.epicId = localEpic.id
      } else {
      throw new com.exalate.api.exception.IssueTrackerException(issueType + " cannot be created: Epic issue with remote id " + replica.epicId + " was not found. Please make sure the epic issue is synchronized before resolving this error" )
      }
      }

      1. Francis Martens (Exalate)

        Ha - I didn't review if epicid is available.  Need to find time to review

      CommentAdd your comment...
    2.  
      1
      0
      -1

      Hi Ziad Qadora


      It is identical, but then you need to test with the epic id


      Did you try the epic sync external script

      It should also cover this case.



        CommentAdd your comment...