Skip to content

Conversation

apognu
Copy link
Contributor

@apognu apognu commented Oct 1, 2025

This PR implements an API endpoint to update select case attributes for a large number of cases. So far, the supported actions are:

  • Close cases
  • Reopen cases
  • Assign cases to user
  • Change cases' inbox

This is a work in progress. Notably, some heavy optmization must be done form this first draft to avoid hammering the database for all cases in the request.

@apognu apognu self-assigned this Oct 1, 2025
@apognu apognu added enhancement New feature or request WIP go Pull requests that update Go code labels Oct 1, 2025
@apognu apognu force-pushed the feat/multi-select-case-actions branch 2 times, most recently from c41ccc0 to 2a23bd8 Compare October 1, 2025 16:26
Copy link
Contributor

@Pascal-Delange Pascal-Delange left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then there is the nastier question of case update side effects.
Currently those include:

  • assign to self (if unassigned)
  • unboost (if boosted)
  • unsnooze (if snoozed)
  • set status to investigating (if pending)

In this context (batch action, most likely from an admin, in any case not by someone who is specifically trying to work on "that one case"), I think there is an argument for doing 2 and 3 but not 1 and 4.

}

// If we are trying to mass-assign, we need to check, for each case, that the target user can manage the case.
if req.Action == models.CaseMassUpdateAssign {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thinking out loud: I think it's correct to make this check in the backend and let the endpoint accept cases from different inboxes, however I think we may want to restrict the action of (re)assigning cases in batch to the "inbox" view, meaning not allow in the "my cases" view, because doing so would create a level of headaches related to selection of eligible users and error handling that is beyond the scope of what we planned to do, cc @ChibiBlasphem

@apognu
Copy link
Contributor Author

apognu commented Oct 1, 2025

Oh yes, the side effects are on my to-do, pending discussion on what we want to do.

@apognu apognu force-pushed the feat/multi-select-case-actions branch 2 times, most recently from 875353f to eb998ec Compare October 2, 2025 09:23
@apognu
Copy link
Contributor Author

apognu commented Oct 2, 2025

As settled on Slack, for now, the only side effect we want is unboosting the affected cases. This is done.

@apognu apognu marked this pull request as ready for review October 2, 2025 09:53
@apognu apognu force-pushed the feat/multi-select-case-actions branch 2 times, most recently from ed95571 to 74cb47f Compare October 6, 2025 09:24
@apognu apognu force-pushed the feat/multi-select-case-actions branch from 74cb47f to 6bcfdeb Compare October 6, 2025 09:52
@apognu apognu merged commit b8aed55 into main Oct 6, 2025
6 checks passed
@apognu apognu deleted the feat/multi-select-case-actions branch October 6, 2025 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request go Pull requests that update Go code WIP

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants