Incoming sync: first sync error

Hi All,

Can you any one help me to get rid of for follow error -

Error Detail Message:
Project key is not set. You need to set a project key in the Sync Rules for {0} connection.

Error Stack Trace:
com.exalate.api.exception.script.CreateProcessorException: Project key is not set. You need to set a project key in the Sync Rules for {0} connection. at jcloudnode.services.jcloud.IssueService.$anonfun$getBasicHubIssueTypeAndProjectKey$8(IssueService.scala:249) at scala.Option.getOrElse(Option.scala:201) at jcloudnode.services.jcloud.IssueService.getBasicHubIssueTypeAndProjectKey(IssueService.scala:244) at jcloudnode.services.jcloud.IssueService.$anonfun$prepareHubIssueForCreate$13(IssueService.scala:1710) at scala.Option.getOrElse(Option.scala:201) at jcloudnode.services.jcloud.IssueService.prepareHubIssueForCreate(IssueService.scala:1710) at jcloudnode.services.jcloud.IssueService.createIssue(IssueService.scala:108) at jcloudnode.services.jcloud.hubobjects.JCloudHubObjectService.createEntity(JCloudHubObjectService.scala:237) at com.exalate.replication.services.processor.ApplyScriptResultService.createEntity(ApplyScriptResultService.scala:81) at com.exalate.replication.services.processor.CreateIssueProcessor.$anonfun$executeScriptRules$4(CreateIssueProcessor.scala:325) at scala.concurrent.impl.Promise$Transformation.run(Promise.scala:470) at akka.dispatch.BatchingExecutor$AbstractBatch.processBatch(BatchingExecutor.scala:63) at akka.dispatch.BatchingExecutor$BlockableBatch.$anonfun$run$1(BatchingExecutor.scala:100) at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18) at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:94) at akka.dispatch.BatchingExecutor$BlockableBatch.run(BatchingExecutor.scala:100) at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:49) at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(ForkJoinExecutorConfigurator.scala:48) at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373) at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182) at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655) at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622) at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)

Please let me know what I need to change.

Kindly help

Thank you!

Hi @Srinivas

Please check this article in regards to the shared error message:

Hi @Srinivas ,

Thanks for posting your question here.

“Project key is not set. You need to set a project key in the Sync Rules for {0} connection.”

This error occurs when Exalate (typically on the Jira side) does not know which project to create incoming issues in.

  1. Go to Exalate > Connections.
  2. Edit the connection showing the error.
  3. In Incoming Sync rules (on Jira side), add:
issue.projectKey = "YOUR_PROJECT_KEY"
  1. Save and retry the sync.

Replace "YOUR_PROJECT_KEY" with the actual Jira project key.

If you are still facing this error please share your connection type and also the incoming script.

Thanks, Dhiren

Hi Dhiren,

I tried. But unfortunately, the error still exits. Don’t mind, can we connect for a quick call? kindly let me know possibility of a quick call.

Thank you!

Regards,
Srinivas

Incoming sync.docx (20.1 KB)

Hi Dhiren,

Below are connection details. The connection was set in the same Jira instance b/w Two Projects DIGITALAKS (Joject key)_to_MINST (project key).

Connection name

DIGITALAKS_to_MINST

Connection type

Local

Destination URL

https://jcloudnode-eyux-gono-yjso-kuwe.exalate.cloud

Destination Issue Tracker URL

https://manulife-gwam.atlassian.net

Hi Dhiren,

Any update?

Thank you!

Regards,
Srinivas

Hi Srinivas,

Let me look into it and will get back to you.

Hi @Srinivas

I have checked and it seems that the project key is missing in the part, when syncing the sub task (between line 100 - 109):

    if(firstSync && replica.parentId && replica.type.name == "Sub-task"){
    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
  } 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" )
    }
}

Add the project key here and then check, if the issue remains, share the local and remote replica.

Hi @Jillani_Fazal ,

I have updated issue key on the between line 100 - 109. please check below. Unfortunately the error still exits.

//}

if(firstSync && replica.parentId && replica.type.name == “Sub-task”){
issue.projectKey = “DIGITALAKS”
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
} 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” )
}
}

About replica:
Local replica does not exist - This message is showing.
Remote replica: Attched
Remote Replica.docx (19.2 KB)

Please check & provide the next steps.

Thank you so so much your help.

Hi @Srinivas

Thank you for the update.

As per the replica shared the project key is set at “GWAMWCAG”:

"hubIssue": {
"voters": [],
"project": {
  "idStr": "11359",
  "key": "GWAMWCAG",
  "name": "GWAM Digital Technologies Accessibility",
  "versions": [],
  "components": []
},

Whereas the error message is indicating that the issue is with the first sync, and as per the incoming sync (first sync), the project key defined there is as “DIGITALAKS”:

    if(firstSync && replica.project.key == "MINST"){
   if(replica.type.name != "Sub-task"){
   issue.projectKey   = "DIGITALAKS" // Project key
   issue.typeName     = nodeHelper.getIssueType(replica.type?.name, issue.projectKey)?.name ?: "Story"
   issue.summary      = replica.summary +' [e]'
   issue.customFields."10001".value = replica.customKeys.Teamtitle

It seems that there is something missing in regards to Project Key, as it is picking up a different project key.

May I know if you are using triggers to initiate the Exalate operation? If yes, then try exalating the work-item manually for the project key “DIGITALAKS” and then check.

Let me know the outcome.