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

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagegroovy
titleOutgoing Sync Salesforce
linenumberstrue
if(entity.entityType == "Case") {
replica.key            = entity.Id
replica.summary        = entity.Subject
replica.description    = entity.Description
replica.comments       = entity.comments
replica.attachments    = entity.attachments
replica.Status         = entity.Status


//Retrieving the email from the last commentcomment 
  
def the_id_variable = entity.Id

def res = httpClient.get("/services/data/v54.0/query?q=SELECT+CommentBody%2CBody%2C+CreatedById%2C+CreatedBy.Email+FROM+CaseCommentCaseFeed+WHERE+ParentId=%27${the_id_variable}%27+ORDER+BY+CreatedDate+DESC+LIMIT+1")

replica.res = res
}





Code Block
languagegroovy
titleIncoming Sync Jira Cloud
linenumberstrue
if (firstSync) {
    issue.projectKey   = "MAT"
    // Set the same issue type as the 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.attachments  = attachmentHelper.mergeAttachments(issue, replica)
issue.labels       = replica.labels


//Impersonating the comment with the right user

def uid = replica.res.records[0].CreatedById
def uid_comments = []

replica.comments.each {
    if(uid == it.author.key) {
        uid_comments.push(it)
    }
}
def latest_message = uid_comments.sort { it.created }[-1].body

replica.addedComments.each { it.executor = nodeHelper.getUserByEmail("${replica.res.records[0].CreatedBy.Email}") }
issue.comments = nodeHelper.toMarkDownComments(commentHelper.mergeComments(issue, replica, { it }))
}













Questions

Questions List
filterrecent
asktrue
include-topicsany
spaceexacom

...