Note

We've packed up and moved from Confluence to Discourse to bring you a better, more interactive space. Out of courtesy we didn't migrate your user account so - you will have to signup again

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
titleZendesk Outgoing Sync

def response = httpClient.get("/api/v2/tickets/${ticket.id}/metrics")

def latest_comment_added_at = ("${response.ticket_metric.latest_comment_added_at}")
replica."latest_comment_added_at" = latest_comment_added_at

def reply_time_in_minutes = ("${response.ticket_metric.reply_time_in_minutes}")
replica."reply_time_in_minutes" = reply_time_in_minutes

def first_resolution_time_in_minutes = ("${response.ticket_metric.first_resolution_time_in_minutes}")
replica."first_resolution_time_in_minutes" = first_resolution_time_in_minutes

def full_resolution_time_in_minutes = ("${response.ticket_metric.full_resolution_time_in_minutes}")
replica."full_resolution_time_in_minutes" = full_resolution_time_in_minutes

def agent_wait_time_in_minutes = ("${response.ticket_metric.agent_wait_time_in_minutes}")
replica."agent_wait_time_in_minutes" = agent_wait_time_in_minutes

def requester_wait_time_in_minutes = ("${response.ticket_metric.requester_wait_time_in_minutes}")
replica."requester_wait_time_in_minutes" = requester_wait_time_in_minutes

def on_hold_time_in_minutes = ("${response.ticket_metric.on_hold_time_in_minutes}")
replica."on_hold_time_in_minutes" = on_hold_time_in_minutes

def solved_at = ("${response.ticket_metric.solved_at}")
replica."solved_at" = solved_at

replica.status       = issue.status



Jira Incoming Sync :

Code Block
languagegroovy
titleJira Incoming Sync
if(replica.status.name == "solved")
{
def p = ""
p+= "Ticket ID : " + replica.key + "\n" + "Latest Comment Added At : "+replica.latest_comment_added_at.values[0] + "\n" + "On Hold Time in Minutes : "+replica.on_hold_time_in_minutes.values[0].calendar + "\n" + "Agent Wait time in Minutes : "+replica.agent_wait_time_in_minutes.values[0].calendar + "\n" + "Solved At : "+replica.solved_at.values[0] + "\n" + "Requester wait time in minutes : " + replica.requester_wait_time_in_minutes.values[0].calendar/60000 + "\n" + "First Resolution time in minutes : "+replica.first_resolution_time_in_minutes.values[0].calendar/60000 + ""
issue.customFields."SLA Info".value = p
}


def statusMapping = ["new":"Open", "open":"Open","pending":"Pending","hold":"Work in Progress","solved":"Done"]
def remoteStatusName = replica.status.name
issue.setStatus(statusMapping[remoteStatusName] ?: remoteStatusName)