The Exalate team will be on holiday for the coming days - returning Jan 4
Enjoy & stay safe

Questions

 
2
1
0

We need to sync also the epic link in the visual mode but there is no given option for that, so we need to have a script for the visual mode. Any ideas?

  1. Ariel Aguilar

    Hi there,

    If it's important to keep the relation on parent tasks and their sub-tasks. You may want to try adding the following additional script:

    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
        } 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" )
        }
    }

    Here is information on how to add the external script, but we usually suggest when getting to this advanced configuration to move to Script based connection instead of Visual:

    https://docs.idalko.com/exalate/x/ogXHAw

    Kind regards,

    Ariel

CommentAdd your comment...

2 answers

  1.  
    1
    0
    -1

    Great! it works wounderful!

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

      Hello, SDGTLS .
      Please try adding an
      Epic Name <> Epic Name
      Mapping and then the following script after it:

      if (executionInstanceName == "SCRUMB") { // SCRUM -> SCRUMB
          // assign fix versions from SCRUM to SCRUMB
          issue.fixVersions = replica
            .fixVersions
            // ensure that all the fixVersions are available on SCRUMB
            .collect { v -> nodeHelper.createVersion(issue, v.name, v.description) }
            
          if(replica."Epic Link"){
             def await = { f -> scala.concurrent.Await$.MODULE$.result(f, scala.concurrent.duration.Duration$.MODULE$.Inf()) }
              def orNull = { opt -> opt.isDefined() ? opt.get() : null }
              
              //getTwinTraceByRelationAndRemoteIssueUrnFuture(connection: IConnection, remoteIssueUrn: String, entityType: String): Future[Option[ITwinTrace]]
              def localEpicTt = orNull(await(syncHelper.twinTraceRepository.getTwinTraceByRelationAndRemoteIssueUrnFuture(connection, replica."Epic Link".getAsString(), 'issue')))
              def localEpic = localEpicTt?.localReplica?.issueKey
              //debug.error("localEpicTt=`${localEpicTt}` replica.'Epic Link'=`${replica."Epic Link"}`")
              if(localEpic){
                  issue."Epic Link" = localEpic.urn
              }
          } else if (issue."Epic Link") {
              issue."Epic Link" = null
          }
      }

      Here's the video showing how it works:


      Happy Exalating!

        CommentAdd your comment...