briank

Kartra Bulk Helpdesk Ticket Updater

Apr 11th, 2026
156
0
Never
7
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Kartra Bulk Helpdesk Ticket Updater (Use With Care!)
  2. // Select tickets to update via filtering, then paste the function below
  3. // and "updateAllTickets();" (without the double-quotes) into the console
  4. // (Command + Option + J (Mac) or Control + Shift + J (PC)).
  5. function updateAllTickets () {
  6. let status;
  7. const tickets = [];
  8. const updateNext = () => {
  9. if (!tickets.length) {
  10. alert('All tickets updated. Page will now reload.');
  11. location.reload();
  12. } else {
  13. const id = tickets.shift();
  14. console.log('Updating ticket ' + id);
  15. $.post(action_route + '/change_status/', { ticket_id: id, action: status }).done(() => setTimeout(updateNext, 500));
  16. }
  17. };
  18. $('.js_ticket_li').each((ind, el) => tickets.push(el.id.replace(/ticket_/, '')));
  19. if (tickets.length) status = prompt(`Enter read, unread, pending, or closed to update ${tickets.length} ticket(s):`);
  20. if (['read', 'unread', 'pending', 'closed'].includes(status)) updateNext();
  21. else alert('No changes made');
  22. }
Advertisement
Comments
  • Ravwevin
    186 days
    Comment was deleted
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • Abqexro
    11 days
    Comment was deleted
Add Comment
Please, Sign In to add comment