Bug 36758 - We should notify an assignee when they are assigned a ticket
Summary: We should notify an assignee when they are assigned a ticket
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: Notices (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Martin Renvoize
QA Contact: Testopia
URL:
Keywords:
Depends on: 35657
Blocks: 15278 34255
  Show dependency treegraph
 
Reported: 2024-05-02 14:20 UTC by Martin Renvoize
Modified: 2024-05-08 12:03 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 36758: Add TICKET_ASSIGNED notice (3.56 KB, patch)
2024-05-07 17:00 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 36758: Add librarian object (1.30 KB, patch)
2024-05-07 17:00 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 36758: Unit tests for assignee notification trigger (3.74 KB, patch)
2024-05-07 17:00 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 36758: Add trigger for assignee notification trigger (3.29 KB, patch)
2024-05-07 17:00 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 36758: Add TICKET_ASSIGNED notice (3.60 KB, patch)
2024-05-08 12:03 UTC, David Nind
Details | Diff | Splinter Review
Bug 36758: Add librarian object (1.35 KB, patch)
2024-05-08 12:03 UTC, David Nind
Details | Diff | Splinter Review
Bug 36758: Unit tests for assignee notification trigger (3.79 KB, patch)
2024-05-08 12:03 UTC, David Nind
Details | Diff | Splinter Review
Bug 36758: Add trigger for assignee notification trigger (3.33 KB, patch)
2024-05-08 12:03 UTC, David Nind
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Renvoize 2024-05-02 14:20:58 UTC
We introduce the ability to assign tickets/concerns to users in bug 35657 but we don't trigger a notification for that assigned user.

We should add the option to send a notice to the new assignee when you are not assigning to yourself.
Comment 1 Martin Renvoize 2024-05-07 17:00:06 UTC
Created attachment 166316 [details] [review]
Bug 36758: Add TICKET_ASSIGNED notice

This patch adds a new default TICKET_ASSIGNED notice to be used with
catalog concerns to notice the assigned staff user when a ticket has
been assigned to them.

Test plan
1) Run the database update and confirm that the new notice has been
   added to the database (If on the sandboxes, skip to the next patch)
Comment 2 Martin Renvoize 2024-05-07 17:00:08 UTC
Created attachment 166317 [details] [review]
Bug 36758: Add librarian object

This patch adds a 'librarian' object fetch to
C4::Letters::GetPreparedLetter when a called passes the 'want_librarian'
flag.

This allows for the notice to take full advantage of the patron object
for that librarian rather than requireing old non-TT syntax for this
feature.

Test plan
1) We use the 'librarian' object in the new TICKET_ASSIGNED default
   notice, use the next patch to test that the librarian title is
   correctly substituted into the notice.
Comment 3 Martin Renvoize 2024-05-07 17:00:10 UTC
Created attachment 166318 [details] [review]
Bug 36758: Unit tests for assignee notification trigger

This patch adds unit tests for the TICKET_ASSIGNED trigger being
introduced with this patchset.

Test plan
1) Run the unit tests prior to the next patch and confirm they fail
2) Apply the next patch and confirm the unit tests now pass
Comment 4 Martin Renvoize 2024-05-07 17:00:13 UTC
Created attachment 166319 [details] [review]
Bug 36758: Add trigger for assignee notification trigger

This patch adds a new notice trigger to allow notifying assigned staff
that they have been assigned a new catalog concern to action.

Test plan
1) Enable catalog concerns (either via staff or opac interfaces)
2) Report a new concern (either via staff or opac interfaces)
3) As a staff user, assign the concern to another staff user
4) Check that the new 'TICKET_ASSIGNED' notice has be queued for that
   staff user.
5) Re-assign the catalog concern to yourself
6) Note that you do not see a 'TICKET_ASSIGNED@ notice queued as you
   self-assigned.
Comment 5 Martin Renvoize 2024-05-07 17:02:10 UTC
Note to RM.. I introduce a new feature to C4::Letters::GetPreparedLetter in here (see 'Add librarian object').  It's perhaps wise to split this into it's own bug, but it's simplest to test inline here.  Let me know if you'd like it split out as it will inevitably be very helpful in the transition to TT notices everywhere.
Comment 6 David Nind 2024-05-08 12:03:44 UTC
Created attachment 166390 [details] [review]
Bug 36758: Add TICKET_ASSIGNED notice

This patch adds a new default TICKET_ASSIGNED notice to be used with
catalog concerns to notice the assigned staff user when a ticket has
been assigned to them.

Test plan
1) Run the database update and confirm that the new notice has been
   added to the database (If on the sandboxes, skip to the next patch)

Signed-off-by: David Nind <david@davidnind.com>
Comment 7 David Nind 2024-05-08 12:03:47 UTC
Created attachment 166391 [details] [review]
Bug 36758: Add librarian object

This patch adds a 'librarian' object fetch to
C4::Letters::GetPreparedLetter when a called passes the 'want_librarian'
flag.

This allows for the notice to take full advantage of the patron object
for that librarian rather than requireing old non-TT syntax for this
feature.

Test plan
1) We use the 'librarian' object in the new TICKET_ASSIGNED default
   notice, use the next patch to test that the librarian title is
   correctly substituted into the notice.

Signed-off-by: David Nind <david@davidnind.com>
Comment 8 David Nind 2024-05-08 12:03:50 UTC
Created attachment 166392 [details] [review]
Bug 36758: Unit tests for assignee notification trigger

This patch adds unit tests for the TICKET_ASSIGNED trigger being
introduced with this patchset.

Test plan
1) Run the unit tests prior to the next patch and confirm they fail
2) Apply the next patch and confirm the unit tests now pass

Signed-off-by: David Nind <david@davidnind.com>
Comment 9 David Nind 2024-05-08 12:03:53 UTC
Created attachment 166393 [details] [review]
Bug 36758: Add trigger for assignee notification trigger

This patch adds a new notice trigger to allow notifying assigned staff
that they have been assigned a new catalog concern to action.

Test plan
1) Enable catalog concerns (either via staff or opac interfaces)
2) Report a new concern (either via staff or opac interfaces)
3) As a staff user, assign the concern to another staff user
4) Check that the new 'TICKET_ASSIGNED' notice has be queued for that
   staff user.
5) Re-assign the catalog concern to yourself
6) Note that you do not see a 'TICKET_ASSIGNED@ notice queued as you
   self-assigned.

Signed-off-by: David Nind <david@davidnind.com>