Originally asked by Harold Oconitrillo on 09 November 2022 (original question)
When a ZD (ZenDesk) ticket is solved, the Jira description is overwritten with the text in the first email/internal note in the linked ticket.
When a ZD ticket is solved, the Jira subject is overwritten with the subject in the ticket.
When a ZD ticket is solved, the Jira labels are overwritten/removed in some cases, it seems.
Can you please help me with this? Is this a common issue? What info do you need in order to help me troubleshoot?
Connection: mbnepmsjira_to_mbzendesk
ZENDESK
Outgoing
replica.key = issue.key
replica.assignee = issue.assignee
replica.reporter = issue.reporter
replica.description = issue.description
replica.type = issue.type
replica.attachments = issue.attachments
replica.status = issue.status
//sending no comments over
Incoming
issue.description = replica.description ?: "No description"
issue.attachments = attachmentHelper.mergeAttachments(issue, replica)
issue.comments = commentHelper.mergeComments(issue, replica, \{
comment ->
comment.internal = true
comment
}
)
//If the status gets changed, insert a comment
if (\!firstSync && \!replica.status.equals(previous?.status)) \{
String message = "The other instance issue status got updated " + [replica.status.name|http://replica.status.name]
issue.comments = commentHelper.addComment(issue.comments)\{ comment ->
comment.body = message
comment.restrictSync = true
comment.internal = true
}
return
}
//if the assignee gets changed, insert a comment
if (\!firstSync && \!replica.assignee.equals(previous?.assignee)) \{
String message = "Assignee on Jira ticket got changed " + replica.assignee.displayName + " " + replica.assignee.email
issue.comments = commentHelper.addComment(issue.comments)\{ comment ->
comment.body = message
comment.restrictSync = true
comment.internal = true
}
return
}
JIRA
*Outgoing*
{code:java}
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
//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)\{
issue.projectKey = "MBSUPPORT"
// Set type name from source issue, if not found set a default
issue.typeName = nodeHelper.getIssueType(replica.type?.name, issue.projectKey)?.name ?: "Task"
}
issue.summary = replica.summary
issue.description = replica.description
issue.comments = commentHelper.mergeComments(issue, replica)
issue.attachments = attachmentHelper.mergeAttachments(issue, replica)
issue.labels = replica.labels
Comments:
Harold Oconitrillo commented on 09 November 2022
Hi,
Could you please implement the below snippet in the Jira incoming?
if(replica.status == ''solved'){ return }
Feel free to contact us back if you have any further question.
Kind regards,
Harold Cruz