Question

How do I forward ticket as a email with PowerShell

  • 22 April 2023
  • 1 reply
  • 34 views

Badge +1

I am trying to forward a ticket to another user. This is the code I am using and I am unable to get it to work any ideas? 

$params = @{
    to_email = "Email@email.com"
    body = "OPTIONAL_NOTE_TO_ADD_TO_THE_TICKET"
}
$credPair = "$APIKey:."
$encodedCredentials = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes($credPair))
$headers = @{ Authorization = "Basic $encodedCredentials" }
 
Invoke-RestMethod "https://domain.com/api/v2/tickets/*TicketNumber*/forward" -Headers $headers  -ContentType "application/json" -Method Post -Body ($params | ConvertTo-Json) -UseBasicParsing


1 reply

Userlevel 7
Badge +13

I am trying to forward a ticket to another user. This is the code I am using and I am unable to get it to work any ideas? 

$params = @{
    to_email = "Email@email.com"
    body = "OPTIONAL_NOTE_TO_ADD_TO_THE_TICKET"
}
$credPair = "$APIKey:."
$encodedCredentials = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes($credPair))
$headers = @{ Authorization = "Basic $encodedCredentials" }
 
Invoke-RestMethod "https://domain.com/api/v2/tickets/*TicketNumber*/forward" -Headers $headers  -ContentType "application/json" -Method Post -Body ($params | ConvertTo-Json) -UseBasicParsing

Hello, 

I can’t find that endpoint in the API web docs. 
Don’t think can send outside of Freshservice with this https://api.freshservice.com/v2/#create_a_note but it’s the closet to what you are looking for. 

You can use the Workflow automater to forward tickets. using Action node and the action “E-mail to”

Reply