1
0
-1

The goal is to have a transition step that uses a custom field that is just a project list to then feed to exalate in order to then create an issue in the destination project and keep them in sync. The source project will most likely always be a service desk project and the destination project will most likely always be a software project on the same cloud instance.


 I took a stab at setting up the sync in advanced mode and trying to use https://docs.idalko.com/exalate/display/ED/How+to+set+the+project+based+on+the+source+issue+custom+field+value as a base.


I am getting an error when syncing....


Unexpected error occurred. The customfield `Jira Team` was assigned to `value=com.exalate.basic.domain.hubobject.v1.BasicHubProject@7e074d9f class=com.exalate.basic.domain.hubobject.v1.BasicHubProject`, but it should have been set to a custom field object Generate an exalate support.zip file and contact support.


outgoing

replica.key            = issue.key
replica.type           = issue.type 
replica.assignee       = issue.assignee 
replica.reporter       = issue.reporter
replica.summary        = issue.summary
replica.description    = issue.description
replica.labels         = issue.labels
replica.comments       = issue.comments
replica.resolution     = issue.resolution
replica.status         = issue.status
replica.parentId       = issue.parentId
replica.priority       = issue.priority
replica.attachments    = issue.attachments
replica.project        = issue.project

replica.customFields."Jira Team" = issue.customFields."Jira Team"

//Comment these lines out if you are interested in sending the full list of versions and components of the source project.
replica.project.versions = []
replica.project.components = []

/*
Custom Fields

replica.customFields."CF Name" = issue.customFields."CF Name"
*/


incoming

if(firstSync){
   // Set project key based on remote Jira Team value 
   issue.projectKey   = nodeHelper.getProject(replica.customFields."Jira Team"?.value?.key)?.key ?: "TEST"
   // Set type name from source issue, if not found set a default
   issue.typeName     = nodeHelper.getIssueType(replica.typeName)?.name ?: "Task"
}
issue.summary      = replica.summary
issue.description  = replica.description
issue.labels       = replica.labels
issue.comments     = commentHelper.mergeComments(issue, replica)
issue.attachments  = attachmentHelper.mergeAttachments(issue, replica)
issue.status       = replica.status
issue.resolution = replica.resolution

/*
User Synchronization (Assignee/Reporter)

Set a Reporter/Assignee from the source side, if the user can't be found set a default user
You can use this approach for custom fields of type User
def defaultUser = nodeHelper.getUserByEmail("default@idalko.com")
issue.reporter = nodeHelper.getUserByEmail(replica.reporter?.email) ?: defaultUser
issue.assignee = nodeHelper.getUserByEmail(replica.assignee?.email) ?: defaultUser
*/
 
/*
Comment Synchronization

Sync comments with the original author if the user exists in the local instance
Remove original Comments sync line if you are using this approach
issue.comments = commentHelper.mergeComments(issue, replica){ it.executor = nodeHelper.getUserByEmail(it.author?.email) }
*/
 
/*
Status Synchronization

Sync status according to the mapping [remote issue status: local issue status]
If statuses are the same on both sides don't include them in the mapping
def statusMapping = ["Open":"New", "To Do":"Backlog"]
def remoteStatusName = replica.status.name
issue.setStatus(statusMapping[remoteStatusName] ?: remoteStatusName)
*/
 
/*
Custom Fields

This line will sync Text, Option(s), Number, Date, Organization, and Labels CFs
For other types of CF check documentation
issue.customFields."CF Name".value = replica.customFields."CF Name".value
*/
    CommentAdd your comment...

    2 answers

    1.  
      1
      0
      -1

      The problematic line is:

      issue.projectKey   = nodeHelper.getProject(replica.customFields."Jira Team"?.value?.key)?.key ?: "TEST"
      

      can you try the following:

      issue.projectKey   = nodeHelper.getProject(replica.customFields."Jira Team"?.value?.key.getAsString())?.key ?: "TEST"
        CommentAdd your comment...
      1.  
        1
        0
        -1

        What this error message states is that there is a type mismatch.

        Can you share the incoming sync processor

        1. Micah Figone

          added outgoing and incoming above.

        CommentAdd your comment...