Originally asked by Shubham Chaudhary on 02 February 2021 (original question)
Answer by Ariel Aguilar on 17 February 2021
Hi Shubham,
For this operation you may want to refer to: https://docs.idalko.com/exalate/display/ED/Syncing+work+items+with+a+parent+link+in+Exalate+for+Azure+DevOps
Let us know if that works for you!
Best regards,
Ariel
Comments:
Shubham Chaudhary commented on 18 February 2021
Hi Ariel,
Thanks for the comment.
I am trying to sync Epic link in b/w Azure and Jira.
So, its working from Azure to Jira but not working from Jira to Azure.
Jira outgoing - I have tried 2 possible script -
- replica.parentId = issue.parentId
OR - replica.parentId = issue.customFields.“10400”.value (10400 is field id)
I have used the exact same script at Azure side suggested by you but it shows below error -
com.exalate.api.exception.script.ScriptException: For input string: “AIT-12” at com.exalate.error.services.ScriptExceptionCategoryService.categorizeProcessorAndIssueTrackerExceptionsIntoScriptExceptions(ScriptExceptionCategoryService.scala:32) at com.exalate.processor.ExalateProcessor.executeProcessor(ExalateProcessor.java:47) at com.exalate.replication.services.processor.ChangeIssueProcessor.$anonfun$executeScriptRules$2(ChangeIssueProcessor.scala:107) at scala.util.Try$.apply(Try.scala:213) at com.exalate.replication.services.processor.ChangeIssueProcessor.executeScriptRules(ChangeIssueProcessor.scala:105) at com.exalate.replication.services.processor.ChangeIssueProcessor.$anonfun$changeIssue$1(ChangeIssueProcessor.scala:84) at scala.concurrent.Future.$anonfun$flatMap$1(Future.scala:307) at scala.concurrent.impl.Promise.$anonfun$transformWith$1(Promise.scala:41) at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:64) at akka.dispatch.BatchingExecutor$AbstractBatch.processBatch(BatchingExecutor.scala:56) at akka.dispatch.BatchingExecutor$BlockableBatch.$anonfun$run$1(BatchingExecutor.scala:93) at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23) at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:85) at akka.dispatch.BatchingExecutor$BlockableBatch.run(BatchingExecutor.scala:93) at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:48) at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(ForkJoinExecutorConfigurator.scala:48) at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289) at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056) at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692) at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157) Caused by: javax.script.ScriptException: javax.script.ScriptException: java.lang.NumberFormatException: For input string: “AIT-12” at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:158) at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:264) at com.exalate.processor.ExalateProcessor.execute(ExalateProcessor.java:72) at com.exalate.processor.ExalateProcessor.executeProcessor(ExalateProcessor.java:45) … 18 more Caused by: javax.script.ScriptException: java.lang.NumberFormatException: For input string: “AIT-12” at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:320) at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:155) … 21 more Caused by: java.lang.NumberFormatException: For input string: “AIT-12” at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) at java.lang.Long.parseLong(Long.java:589) at java.lang.Long.valueOf(Long.java:803) at org.codehaus.groovy.runtime.StringGroovyMethods.toLong(StringGroovyMethods.java:3613) at org.codehaus.groovy.runtime.dgm$1228.invoke(Unknown Source) at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:244) at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:53) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:115) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:119) at Script106.run(Script106.groovy:32) at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:317) … 22 more
Could you please provide your input?
Ariel Aguilar commented on 22 February 2021
Hi Shubham,
Sorry for the misunderstanding, but currently the only Azure relation we support is Parent - Child link synchronization. Unfortunately, it is not possible to sync Epic to Story relation between Azure and Jira.
Let me know if you require additional help.
Best regards,
Ariel
Shubham Chaudhary commented on 24 February 2021
Hi Ariel,
We are able to sync Parent of PBI (Story) of Azure to Story in Jira using below code -
Azure outgoing -
replica.parentId = workItem.parentId
Jira Incoming -
if(issue.typeName.equals(“Story”)){
def localParentKey = nodeHelper.getLocalIssueKeyFromRemoteId(replica.parentId)
if(localParentKey){
issue.customFields.“Epic Link”.value = localParentKey.urn
}
}
But when we are trying to sync Epic link(Parent link) of Jira Story to PBI in Azure.
It should be able to sync vice versa!