[Problem/Question]
As a user in my react native app:
- I am unable to see a list of my tickets which are active
- I am unable to see a list of my tickets which are closed
// If problem, please fill out the below. If question, please delete.
[SDK Version]
“sendbird”: “^3.1.33”,
“sendbird-desk”: “^1.1.2”,
[Reproduction Steps]
I am able to create a ticket using sendbird desk and send a message as a user. The message shows up in the desk dashboard for an agent. Now, as a user, I want to see a list of active tickets where I am included and also a list of closed tickets where I am included.
From the docs I tried this code:
I am not sure about:
- How to get the group property or if it is mandatory
- How to filter and only display tickets where the current user is a member
- Even if I pass an empty params object without any properties, I get the error:
[ReferenceError: Property ‘status’ doesn’t exist]
const params = {
group: 'my_group',
// Add any parameters you wish to use.
// offset: integer.
// customFieldFilter: object.
// ticket status: string.
};
Ticket.getList(params, (tickets, error) => {
if (error) {
// Handle error.
}
const ticketsFromMyGroup = tickets;
console.log('tickets', tickets)
// offset += tickets.length; for the next tickets.
// Implement your code to display the ticket list.
})
LOG: tickets null
After not being able to run the above code, I tried the below code, using getOpenedList and getClosedList methods. However, I am still getting the error:
Reference Error: Property ‘status’ doesn’t exist.
export async function loadTickets(status, offset, cb) {
switch (status) {
case SendbirdDesk.Ticket.Status.OPEN:
console.log('Fetching active tickets');
SendbirdDesk.Ticket.getOpenedList(offset, (res, error) => {
if (error) throw error;
const tickets = res;
console.log('activeTickets', res)
cb(res, error);
})
break;
case SendbirdDesk.Ticket.Status.CLOSED:
console.log('Fetching closed tickets');
SendbirdDesk.Ticket.getClosedList(offset, (res, error) => {
if (error) throw error;
const tickets = res;
console.log('closedTickets', res)
cb(res, error);
})
break;
default:
cb(null, []);
}
}
[Frequency]
Everytime
[Current impact]
The user cannot view the tickets they are included in