Question

Set Status as Open on Specific Date/Time

  • 25 March 2022
  • 4 replies
  • 874 views

Badge

Hello,

We as a company have only recently started using Freshdesk following leaving an old ITSM solution. I can’t see anyone has mentioned this in the forums or from searches online so I thought I’d message here.

We support a large number of schools for their IT issues, teachers are generally always teaching and they will say to us to contact them at say 12pm on Wednesday.

In our old ITSM we could put the ticket on hold/pending and set it to open on a specific date/time by setting this in a field, the ticket would then change to an open state once that specific date/time is reached.

I can’t see any way to do this in Freshdesk. I know you can use the To-Do list feature to set a reminder but this doesn’t take the ticket from a Pending state to an Open state, it just sits as Pending requiring the assigned user to set it as Open themselves. Is there a way for the To-Do list to automate this to set as Open? If this was possible then that would be a really good solution for us

Does anyone have any tips, recommendations or workarounds please? Thank you.


4 replies

Userlevel 4
Badge +7

@RFHfL we had the exact same request. We ended up building this ourselves using the API and powershell (although as other have mentioned if you have access to powerautomate this can be easier there. The basics are as follows:

 

  1. Create a new status of “scheduled” or whatever makes sense in your situation
  2. Create a ticket field for “Scheduled Date”
  3. Use business Rules to show and require the scheduled date when it is in that status as shown:
  4. Then utilize the API to retrieve all tickets with a date scheduled older than ‘today’ and set them all to open and clear the date scheduled field here is an example in powershell (although you will need to setup the headers, using examples from others) 
     function Get-FSFilteredTickets {
    param (
    [string]
    [parameter(Mandatory)]
    $querystring
    )
    $tickets = @()
    $encoded = [system.web.httputility]::urlencode($querystring)
    try {
    $tickets = (Invoke-RestMethod -Headers $script:headers -Method Get -Uri "$script:freshserviceURL/tickets/filter?query=`"$encoded`"" -ContentType 'application/json' -ResponseHeadersVariable ResponseHeader).tickets
    }
    catch {
    if ($_ -eq "no such host is known") {
    Throw "no such host is known"
    }
    Write-Error -Message "querystring = $querystring"
    Write-Error -Message $_

    }
    while ($ResponseHeader.Keys.Contains('Link')) {
    $URL = [regex]::Match($ResponseHeader.Link[0].ToString(), "(?<=\<)(.*?)(?=\>)").value
    try {
    $tickets = $tickets + (Invoke-RestMethod -Headers $script:headers -Method Get -Uri $URL -ContentType 'application/json' -ResponseHeadersVariable ResponseHeader).tickets
    }
    catch {
    Write-Error -Message "URL = $url"
    Write-Error -Message $_
    }
    }

    return $tickets

    }

    function set-FSTicketProperties {
    param (
    [parameter(Mandatory)]
    [PSCustomObject]
    $fields,
    [parameter(Mandatory)]
    [int]
    $TicketID
    )
    $ticket = Get-FSTicketByID -TicketID $TicketID
    if ($ticket.type -eq 'Service Request' -and $ticket.description -eq '') {
    $fields | Add-Member -NotePropertyName description -NotePropertyValue $ticket.subject
    }
    $Updatejson = ConvertTo-Json -InputObject $fields -EscapeHandling EscapeNonAscii
    try {
    $Ticket = (Invoke-RestMethod -Headers $script:headers -Method put -Uri "$freshserviceURL/tickets/$TicketID" -body $Updatejson -ContentType 'application/json' -ResponseHeadersVariable ResponseHeader).ticket
    }
    catch {
    Write-Error -Message "Ticket ID: $TicketID"
    Write-Error -Message $_
    $message = $_ | ConvertFrom-Json
    Throw "Error Updating Ticket Set-FSTicketProperties, TicketID: $ticketID Error Message: $_ "
    }
    return $Ticket
    }

    $today = (get-date).tostring('yyyy-MM-dd')
    $scheduledTickets = Get-FSFilteredTickets -querystring "date_scheduled :< `'$today`' AND status:6"
    foreach ($ticket in $scheduledTickets) {
    $ticketFields = [PSCustomObject]@{
    status = 2
    custom_fields = @{
    date_scheduled = $null
    }
    }
    set-FSTicketProperties -TicketID $ticket.id -fields $ticketFields | Out-Null
    }
  5. If you only use date (and not DateTime) then you can run this once per day, if you wanted the agent to also select a time when it would re-open, you could modify the date compare and run it on some regular interval like 5 minutes. Because we are using the filtered API call it is pretty low cost from an execution time perpective.

Feel free to reach out to me if you have any questions or need some help putting this together. We LOVE using this, in-fact we have many alternate statuses that our team can use to help them focus on the items that they can move each one has it’s own workflow around when and how the ticket comes back to OPEN. here is our list of statuses that we use: (open is just before pending)


 

 

Userlevel 1
Badge +3

Hi Guys,

Welcome to Freshworks Community.

I understand your requirement. Best way to do this would be to trigger a time trigger automation under Admin>Automations>Time triggers. Here you can define a condition when a ticket has been in ANY status for a certain period of time(this is defined in hours as time triggers run every hour inside Freshdesk) to perform action: change status to another status. 

Using this, you can also trigger a notification to the agent to remind them of the same. Let me show you with an example:

 

Let me know if this helps you :)

Cheers!

Userlevel 1
Badge +3

Hi team,

 

Welcome to Freshworks Community.

 

I understand your requirement. The best way to do this would be to trigger a time trigger automation under Admin>Automations>Time triggers. Here you can define a condition when a ticket has been in ANY status for a certain period of time(this is defined in hours as time triggers run every hour inside Freshdesk) to perform action: change status to another status. 

 

Using this, you can also trigger a notification to the agent to remind them of the same. Let me show you an example:

 

 

gICX_b-Onv2oOeqqb9NfSAIV7vpFe9uvfw1R0Gz9IX4RulRwUjaP0fuML9BOuXbw6-x1q6kFMG3T1uoAmEfVV7s6XcgW2JOHJHIAWnmm6JKYTjNCTPxPWILZj5fatfdF2ifCWztz

Let me know if this helps you :)

 

Cheers!
 

Badge +1

@RFHfL we had the exact same request. We ended up building this ourselves using the API and powershell (although as other have mentioned if you have access to powerautomate this can be easier there. The basics are as follows:

<snip>

@ggallaway I just came across this as we have a similar requirement to RFHfl.  The one thing that wasn’t clear to me is how to use date and time as Freshdesk only seems to allow a date field rather than a date/time one.  Presume the only way around it is to fudge it by using a separate text field as the time component?

Reply