Reopen ticket through API

lock
push_pin
done
Answered
2

How do I reopen a ticket with status=Closed? It seems to ignore the state on TicketEntity. I would think the following should work, but the status on the ticket remains Closed

 

 

        var ticket = await agent.GetTicketEntityAsync(ticketId);
        ticket.BaseStatus = TicketBaseStatus.Active;
        await agent.SaveTicketEntityAsync(ticket);

        var newTicket = await agent.GetTicketEntityAsync(ticketId);
        if(newTicket.BaseStatus != TicketBaseStatus.Active){
            throw new Exception(":exploding_head:");
        }

14 May 2024 | 06:27 AM

All Replies (2)

Hi Snorre,

You also need to update the actual ticket status property, not just the underlying base status.

14 May 2024 | 07:02 AM

I tried that first without success, but now I got it to work if setting both TicketStatusId and Status on TicketEntity.Status.

Should I set both BaseStatus and Status?

 

14 May 2024 | 07:07 AM

Add reply