Bug 35657 - Add ability to assign tickets to librarians for catalog concerns
Summary: Add ability to assign tickets to librarians for catalog concerns
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Martin Renvoize (ashimema)
QA Contact: Marcel de Rooy
URL:
Keywords:
Depends on: 32435
Blocks: 32436 34255 36753 36754 36759 36801 36757 36758 36760
  Show dependency treegraph
 
Reported: 2023-12-28 12:58 UTC by Martin Renvoize (ashimema)
Modified: 2024-09-13 19:08 UTC (History)
7 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact: Caroline Cyr La Rose
Documentation submission: https://gitlab.com/koha-community/koha-manual/-/merge_requests/957
Text to go in the release notes:
This enhancement adds to the ability to assign tickets to librarians in the catalog concerns feature. **Sponsored by** *PTFS Europe*
Version(s) released in:
24.05.00
Circulation function:


Attachments
Bug 35657: Add assignee_id to tickets and ticket_updates (3.72 KB, patch)
2023-12-29 12:13 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 35657: Schema (5.17 KB, patch)
2023-12-29 12:13 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 35657: Add support for assignee_id to ticket_updates endpoint (6.19 KB, patch)
2023-12-29 12:13 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 35657: Add option to set assignee during update (6.04 KB, patch)
2023-12-29 12:13 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 35657: Display assignee under 'Status' column (1.29 KB, patch)
2023-12-29 12:13 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 35657: Add assignee_id to tickets and ticket_updates (3.72 KB, patch)
2023-12-29 17:49 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 35657: Schema (5.17 KB, patch)
2023-12-29 17:49 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 35657: Add support for assignee_id to ticket_updates endpoint (6.19 KB, patch)
2023-12-29 17:49 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 35657: Add option to set assignee during update (6.04 KB, patch)
2023-12-29 17:49 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 35657: Display assignee under 'Status' column (1.29 KB, patch)
2023-12-29 17:49 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 35657: Display assignee under updates (4.19 KB, patch)
2023-12-29 17:49 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 35657: Add assignee_id to tickets and ticket_updates (3.72 KB, patch)
2024-04-16 12:44 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 35657: Schema (5.17 KB, patch)
2024-04-16 12:44 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 35657: Add support for assignee_id to ticket_updates endpoint (6.31 KB, patch)
2024-04-16 12:44 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 35657: Add option to set assignee during update (6.04 KB, patch)
2024-04-16 12:44 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 35657: Display assignee under 'Status' column (1.29 KB, patch)
2024-04-16 12:44 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 35657: Display assignee under updates (4.19 KB, patch)
2024-04-16 12:44 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 35657: Add assignee_id to tickets and ticket_updates (3.72 KB, patch)
2024-04-16 13:14 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 35657: Schema update (5.17 KB, patch)
2024-04-16 13:14 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 35657: Add support for assignee_id to ticket_updates endpoint (6.27 KB, patch)
2024-04-16 13:14 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 35657: Add option to set assignee during update (10.70 KB, patch)
2024-04-16 13:14 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 35657: Add assignee_id to tickets and ticket_updates (3.78 KB, patch)
2024-04-17 07:16 UTC, Paul Derscheid
Details | Diff | Splinter Review
Bug 35657: Schema update (5.22 KB, patch)
2024-04-17 07:16 UTC, Paul Derscheid
Details | Diff | Splinter Review
Bug 35657: Add support for assignee_id to ticket_updates endpoint (6.31 KB, patch)
2024-04-17 07:16 UTC, Paul Derscheid
Details | Diff | Splinter Review
Bug 35657: Add option to set assignee during update (10.75 KB, patch)
2024-04-17 07:16 UTC, Paul Derscheid
Details | Diff | Splinter Review
Bug 35657: Add assignee_id to tickets and ticket_updates (3.72 KB, patch)
2024-04-26 16:09 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 35657: Schema update (5.17 KB, patch)
2024-04-26 16:09 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 35657: Add support for assignee_id to ticket_updates endpoint (6.39 KB, patch)
2024-04-26 16:09 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 35657: Add option to set assignee during update (10.70 KB, patch)
2024-04-26 16:09 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 35657: Unit tests for relation accessor additions (2.79 KB, patch)
2024-04-26 16:09 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 35657: Unit tests for ticket_update api addition (4.20 KB, patch)
2024-04-26 16:09 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 35657: Unit test for addition to tickets endpoint (1.95 KB, patch)
2024-04-26 16:09 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 35657: Add assignee_id to tickets and ticket_updates (3.78 KB, patch)
2024-04-26 16:12 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 35657: Schema update (5.23 KB, patch)
2024-04-26 16:12 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 35657: Add support for assignee_id to ticket_updates endpoint (6.45 KB, patch)
2024-04-26 16:12 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 35657: Add option to set assignee during update (10.76 KB, patch)
2024-04-26 16:12 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 35657: Unit tests for relation accessor additions (2.85 KB, patch)
2024-04-26 16:12 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 35657: Unit tests for ticket_update api addition (4.26 KB, patch)
2024-04-26 16:12 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 35657: Unit test for addition to tickets endpoint (2.01 KB, patch)
2024-04-26 16:12 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 35657: Add assignee_id to tickets and ticket_updates (3.78 KB, patch)
2024-04-29 17:56 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 35657: Schema update (5.23 KB, patch)
2024-04-29 17:56 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 35657: Add support for assignee_id to ticket_updates endpoint (6.50 KB, patch)
2024-04-29 17:56 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 35657: Add option to set assignee during update (10.93 KB, patch)
2024-04-29 17:56 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 35657: Unit tests for relation accessor additions (2.85 KB, patch)
2024-04-29 17:56 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 35657: Unit tests for ticket_update api addition (4.26 KB, patch)
2024-04-29 17:56 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 35657: Unit test for addition to tickets endpoint (2.01 KB, patch)
2024-04-29 17:56 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 35657: (follow-up) Add missing DB update (2.17 KB, patch)
2024-04-30 12:59 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 35657: Add assignee_id to tickets and ticket_updates (3.87 KB, patch)
2024-04-30 13:38 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 35657: Schema update (4.48 KB, patch)
2024-04-30 13:38 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 35657: Add support for assignee_id to ticket_updates endpoint (6.58 KB, patch)
2024-04-30 13:38 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 35657: Add option to set assignee during update (11.02 KB, patch)
2024-04-30 13:38 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 35657: Unit tests for relation accessor additions (2.94 KB, patch)
2024-04-30 13:39 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 35657: Unit tests for ticket_update api addition (4.35 KB, patch)
2024-04-30 13:39 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 35657: Unit test for addition to tickets endpoint (2.10 KB, patch)
2024-04-30 13:39 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 35657: (follow-up) Add missing DB update (2.26 KB, patch)
2024-04-30 13:39 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 35657: (follow-up) Placeholders should be translatable (990 bytes, patch)
2024-05-02 12:17 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Renvoize (ashimema) 2023-12-28 12:58:55 UTC
It would be helpful to add the option to assign tickets to librarians for the catalog concerns feature.  This is especially helpful for the future of this development in regard to using it as a framework for a full ticketing/enquiry management system/module.
Comment 1 Martin Renvoize (ashimema) 2023-12-28 14:41:28 UTC
Notes to self.. this has a few different API options.

* `PUT /tickets/{ticket_id}` where we just update an `assignee_id` field directly
* `POST /tickets/{ticket_id}/updates` where we add an `assignee_id` field into the update and sync that across to the tickets table too (this allows for tracking of when, who, message etc at the same time)
* Supporting both of the above, and ensuring two-way sync such that a POST to /updates sets the ticket.assignee_id but also a PUT to /tickets with a new assignee_id also adds a new ticket_update including the who, when but no message.

My gut it telling me to go with the last option, allowing for updates via the modal and also quick assignee updates via action buttons in the main table.
Comment 2 Martin Renvoize (ashimema) 2023-12-29 12:13:10 UTC
Created attachment 160365 [details] [review]
Bug 35657: Add assignee_id to tickets and ticket_updates

This patch updates the tickets and ticket_updates tables to include a
assignee_id.
Comment 3 Martin Renvoize (ashimema) 2023-12-29 12:13:12 UTC
Created attachment 160366 [details] [review]
Bug 35657: Schema
Comment 4 Martin Renvoize (ashimema) 2023-12-29 12:13:14 UTC
Created attachment 160367 [details] [review]
Bug 35657: Add support for assignee_id to ticket_updates endpoint

This patch starts to add support for cross-synced ticket.assignee_id
updates.  You should be able to either set assignee at the time of
adding a ticket_update or directly on the ticket.. but in both cases end
up with a ticket_update with the fine details of when and who set the
assigee.
Comment 5 Martin Renvoize (ashimema) 2023-12-29 12:13:17 UTC
Created attachment 160368 [details] [review]
Bug 35657: Add option to set assignee during update
Comment 6 Martin Renvoize (ashimema) 2023-12-29 12:13:19 UTC
Created attachment 160369 [details] [review]
Bug 35657: Display assignee under 'Status' column
Comment 7 Martin Renvoize (ashimema) 2023-12-29 12:13:47 UTC
Still a work in progress here..
Comment 8 Martin Renvoize (ashimema) 2023-12-29 17:49:15 UTC
Created attachment 160372 [details] [review]
Bug 35657: Add assignee_id to tickets and ticket_updates

This patch updates the tickets and ticket_updates tables to include a
assignee_id.
Comment 9 Martin Renvoize (ashimema) 2023-12-29 17:49:17 UTC
Created attachment 160373 [details] [review]
Bug 35657: Schema
Comment 10 Martin Renvoize (ashimema) 2023-12-29 17:49:20 UTC
Created attachment 160374 [details] [review]
Bug 35657: Add support for assignee_id to ticket_updates endpoint

This patch starts to add support for cross-synced ticket.assignee_id
updates.  You should be able to either set assignee at the time of
adding a ticket_update or directly on the ticket.. but in both cases end
up with a ticket_update with the fine details of when and who set the
assigee.
Comment 11 Martin Renvoize (ashimema) 2023-12-29 17:49:23 UTC
Created attachment 160375 [details] [review]
Bug 35657: Add option to set assignee during update
Comment 12 Martin Renvoize (ashimema) 2023-12-29 17:49:25 UTC
Created attachment 160376 [details] [review]
Bug 35657: Display assignee under 'Status' column
Comment 13 Martin Renvoize (ashimema) 2023-12-29 17:49:28 UTC
Created attachment 160377 [details] [review]
Bug 35657: Display assignee under updates
Comment 14 cgentry1 2024-04-09 12:38:50 UTC
I am eagerly hoping this feature is added to Cataloging Concerns! Thanks for working on this. - Chelsea
Comment 15 Martin Renvoize (ashimema) 2024-04-16 12:44:36 UTC
Created attachment 164923 [details] [review]
Bug 35657: Add assignee_id to tickets and ticket_updates

This patch updates the tickets and ticket_updates tables to include a
assignee_id.
Comment 16 Martin Renvoize (ashimema) 2024-04-16 12:44:39 UTC
Created attachment 164924 [details] [review]
Bug 35657: Schema
Comment 17 Martin Renvoize (ashimema) 2024-04-16 12:44:41 UTC
Created attachment 164925 [details] [review]
Bug 35657: Add support for assignee_id to ticket_updates endpoint

This patch starts to add support for cross-synced ticket.assignee_id
updates.  You should be able to either set assignee at the time of
adding a ticket_update or directly on the ticket.. but in both cases end
up with a ticket_update with the fine details of when and who set the
assigee.
Comment 18 Martin Renvoize (ashimema) 2024-04-16 12:44:44 UTC
Created attachment 164926 [details] [review]
Bug 35657: Add option to set assignee during update
Comment 19 Martin Renvoize (ashimema) 2024-04-16 12:44:46 UTC
Created attachment 164927 [details] [review]
Bug 35657: Display assignee under 'Status' column
Comment 20 Martin Renvoize (ashimema) 2024-04-16 12:44:49 UTC
Created attachment 164928 [details] [review]
Bug 35657: Display assignee under updates
Comment 21 Martin Renvoize (ashimema) 2024-04-16 12:45:14 UTC
Branch fully rebased so this should be simple enough to test now :)
Comment 22 Martin Renvoize (ashimema) 2024-04-16 13:14:02 UTC
Created attachment 164932 [details] [review]
Bug 35657: Add assignee_id to tickets and ticket_updates

This patch updates the tickets and ticket_updates tables to include a
assignee_id.
Comment 23 Martin Renvoize (ashimema) 2024-04-16 13:14:04 UTC
Created attachment 164933 [details] [review]
Bug 35657: Schema update
Comment 24 Martin Renvoize (ashimema) 2024-04-16 13:14:07 UTC
Created attachment 164934 [details] [review]
Bug 35657: Add support for assignee_id to ticket_updates endpoint

This patch adds support for cross-synced ticket.assignee_id updates.

The API allows you to set assignee directly on a ticket or via a
ticket_update. In both cases we store a ticket_update with the fine
details of when and who set the assigee.
Comment 25 Martin Renvoize (ashimema) 2024-04-16 13:14:09 UTC
Created attachment 164935 [details] [review]
Bug 35657: Add option to set assignee during update

This patch exposes the UI to allow setting assignee from the ticket
update modal.

Test plan
1) Apply the patches and run the database updates
2) Enable catalog concerns - `CatalogConcerns` or `OPACCatalogConcerns`
3) Submit a catalog concern via the OPAC or Staff client biblio page
4) Navigate to the concerns management page 'Cataloging > Catalog
   concerns'
5) Note there is no assignee displayed in the status field for your new
   concern.
6) Click the concern to view it's details
7) Note that in the modal there is now a new 'Change assignee' option
8) Use this new option to search for and assign a librarian to the
   concern.
9) Submit the update
10) Your assignee should now appear in the 'status' data field in the
    table
11) Clicking through to details again, you should see when the assignee
    was set and should also be able to re-assign it
Comment 26 Paul Derscheid 2024-04-16 14:35:06 UTC
Sorry, there's one problem:

When creating a concern from the OPAC w/ an account that doesn't have an email address associated, we get:
[2024/04/16 14:24:29] [WARN] FAIL: No 'to_address', email address or guarantors email address for borrowernumber (51) at /kohadevbox/koha/C4/Letters.pm line 1366.

Also there's a stack trace in ktd when you set an email address for the `koha` user, but I wrote that off as related to ktd.

That's fine and there's also an error message displayed to the user:
> There was an error when submitting your concern, please contact a librarian.

The problem is that that concern still goes through and is visible in the associated concerns for that biblio.

Of course the feature works but could you still fix that before the sign-off.
Maybe either
- block the concern from going through
- use a more descriptive error message
Comment 27 Martin Renvoize (ashimema) 2024-04-16 15:43:15 UTC
Interesting bug you've found there.. thanks.  I'm contemplating whether that's important enough to warrant fixing on it's own bug of just dealing with it inline here.... think I'll cmull it over on the school run.
Comment 28 Paul Derscheid 2024-04-16 16:07:03 UTC
If you decide to move that bug outside of the scope of this one and make it dependent on the new one, we could certainly move this one forward, right?
Comment 29 Martin Renvoize (ashimema) 2024-04-16 18:30:00 UTC
OK.. I added it as it's own bug as it's unrelated to this one and should certainly be backported as a bugfix.  Please see bug 36612
Comment 30 Martin Renvoize (ashimema) 2024-04-16 18:31:02 UTC
The warn in C4::Letters appears to be deliberate.. though it's rather noisy.. I reckon that should also go on it's own bug some time to clean up the warns.. the details are now reported in the UI anyway so the warns are a bit superflous.
Comment 31 Paul Derscheid 2024-04-16 19:30:09 UTC
Will do a sign-off tomorrow.
Comment 32 Paul Derscheid 2024-04-17 07:16:47 UTC
Created attachment 164974 [details] [review]
Bug 35657: Add assignee_id to tickets and ticket_updates

This patch updates the tickets and ticket_updates tables to include a
assignee_id.

Signed-off-by: Paul Derscheid <paulderscheid@gmail.com>
Comment 33 Paul Derscheid 2024-04-17 07:16:49 UTC
Created attachment 164975 [details] [review]
Bug 35657: Schema update

Signed-off-by: Paul Derscheid <paulderscheid@gmail.com>
Comment 34 Paul Derscheid 2024-04-17 07:16:51 UTC
Created attachment 164976 [details] [review]
Bug 35657: Add support for assignee_id to ticket_updates endpoint

This patch adds support for cross-synced ticket.assignee_id updates.

The API allows you to set assignee directly on a ticket or via a
ticket_update. In both cases we store a ticket_update with the fine
details of when and who set the assigee.

Signed-off-by: Paul Derscheid <paulderscheid@gmail.com>
Comment 35 Paul Derscheid 2024-04-17 07:16:54 UTC
Created attachment 164977 [details] [review]
Bug 35657: Add option to set assignee during update

This patch exposes the UI to allow setting assignee from the ticket
update modal.

Test plan
1) Apply the patches and run the database updates
2) Enable catalog concerns - `CatalogConcerns` or `OPACCatalogConcerns`
3) Submit a catalog concern via the OPAC or Staff client biblio page
4) Navigate to the concerns management page 'Cataloging > Catalog
   concerns'
5) Note there is no assignee displayed in the status field for your new
   concern.
6) Click the concern to view it's details
7) Note that in the modal there is now a new 'Change assignee' option
8) Use this new option to search for and assign a librarian to the
   concern.
9) Submit the update
10) Your assignee should now appear in the 'status' data field in the
    table
11) Clicking through to details again, you should see when the assignee
    was set and should also be able to re-assign it

Signed-off-by: Paul Derscheid <paulderscheid@gmail.com>
Comment 36 Marcel de Rooy 2024-04-26 07:34:50 UTC
[2024/04/26 07:34:03] [ERROR] GET /api/v1/tickets: unhandled exception (DBIx::Class::Exception)<<DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Unknown column 'me.assignee_id' in 'field list' at /usr/share/koha/Koha/Objects.pm line 399>>
Comment 37 Marcel de Rooy 2024-04-26 07:35:11 UTC
No unit tests here?
Comment 38 Marcel de Rooy 2024-04-26 07:36:12 UTC
(In reply to Marcel de Rooy from comment #36)
> [2024/04/26 07:34:03] [ERROR] GET /api/v1/tickets: unhandled exception
> (DBIx::Class::Exception)<<DBIx::Class::Storage::DBI::_dbh_execute(): DBI
> Exception: DBD::mysql::st execute failed: Unknown column 'me.assignee_id' in
> 'field list' at /usr/share/koha/Koha/Objects.pm line 399>>

A 500 when loading the staff detail page for a biblio with concerns.
Hmm, this concerns me :)
Comment 39 Martin Renvoize (ashimema) 2024-04-26 13:19:07 UTC
Definitely needs Unit tests.. I clearly forgot to attach those.. I'll go dig out the branch and get them submitted.

As for your 500 Error.. I think that's a missing DB update..
Comment 40 Martin Renvoize (ashimema) 2024-04-26 16:09:08 UTC
Created attachment 165666 [details] [review]
Bug 35657: Add assignee_id to tickets and ticket_updates

This patch updates the tickets and ticket_updates tables to include a
assignee_id.
Comment 41 Martin Renvoize (ashimema) 2024-04-26 16:09:12 UTC
Created attachment 165667 [details] [review]
Bug 35657: Schema update
Comment 42 Martin Renvoize (ashimema) 2024-04-26 16:09:14 UTC
Created attachment 165668 [details] [review]
Bug 35657: Add support for assignee_id to ticket_updates endpoint

This patch adds support for cross-synced ticket.assignee_id updates.

The API allows you to set assignee directly on a ticket or via a
ticket_update. In both cases we store a ticket_update with the fine
details of when and who set the assigee.
Comment 43 Martin Renvoize (ashimema) 2024-04-26 16:09:17 UTC
Created attachment 165669 [details] [review]
Bug 35657: Add option to set assignee during update

This patch exposes the UI to allow setting assignee from the ticket
update modal.

Test plan
1) Apply the patches and run the database updates
2) Enable catalog concerns - `CatalogConcerns` or `OPACCatalogConcerns`
3) Submit a catalog concern via the OPAC or Staff client biblio page
4) Navigate to the concerns management page 'Cataloging > Catalog
   concerns'
5) Note there is no assignee displayed in the status field for your new
   concern.
6) Click the concern to view it's details
7) Note that in the modal there is now a new 'Change assignee' option
8) Use this new option to search for and assign a librarian to the
   concern.
9) Submit the update
10) Your assignee should now appear in the 'status' data field in the
    table
11) Clicking through to details again, you should see when the assignee
    was set and should also be able to re-assign it
Comment 44 Martin Renvoize (ashimema) 2024-04-26 16:09:20 UTC
Created attachment 165670 [details] [review]
Bug 35657: Unit tests for relation accessor additions

This patch adds the unit tests for the new 'assignee' relation accessors
added to Koha::Ticket and Koha::Ticket::Update classes.
Comment 45 Martin Renvoize (ashimema) 2024-04-26 16:09:23 UTC
Created attachment 165671 [details] [review]
Bug 35657: Unit tests for ticket_update api addition

This patch adds unit tests for the addition of assignee handling in the
ticket update endpoint
Comment 46 Martin Renvoize (ashimema) 2024-04-26 16:09:26 UTC
Created attachment 165672 [details] [review]
Bug 35657: Unit test for addition to tickets endpoint

This patch adds a unit test for the additional option of now setting the
assignee from the tickets update endpoint.
Comment 47 Martin Renvoize (ashimema) 2024-04-26 16:12:08 UTC
Created attachment 165673 [details] [review]
Bug 35657: Add assignee_id to tickets and ticket_updates

This patch updates the tickets and ticket_updates tables to include a
assignee_id.

Signed-off-by: Paul Derscheid <paulderscheid@gmail.com>
Comment 48 Martin Renvoize (ashimema) 2024-04-26 16:12:11 UTC
Created attachment 165674 [details] [review]
Bug 35657: Schema update

Signed-off-by: Paul Derscheid <paulderscheid@gmail.com>
Comment 49 Martin Renvoize (ashimema) 2024-04-26 16:12:14 UTC
Created attachment 165675 [details] [review]
Bug 35657: Add support for assignee_id to ticket_updates endpoint

This patch adds support for cross-synced ticket.assignee_id updates.

The API allows you to set assignee directly on a ticket or via a
ticket_update. In both cases we store a ticket_update with the fine
details of when and who set the assigee.

Signed-off-by: Paul Derscheid <paulderscheid@gmail.com>
Comment 50 Martin Renvoize (ashimema) 2024-04-26 16:12:17 UTC
Created attachment 165676 [details] [review]
Bug 35657: Add option to set assignee during update

This patch exposes the UI to allow setting assignee from the ticket
update modal.

Test plan
1) Apply the patches and run the database updates
2) Enable catalog concerns - `CatalogConcerns` or `OPACCatalogConcerns`
3) Submit a catalog concern via the OPAC or Staff client biblio page
4) Navigate to the concerns management page 'Cataloging > Catalog
   concerns'
5) Note there is no assignee displayed in the status field for your new
   concern.
6) Click the concern to view it's details
7) Note that in the modal there is now a new 'Change assignee' option
8) Use this new option to search for and assign a librarian to the
   concern.
9) Submit the update
10) Your assignee should now appear in the 'status' data field in the
    table
11) Clicking through to details again, you should see when the assignee
    was set and should also be able to re-assign it

Signed-off-by: Paul Derscheid <paulderscheid@gmail.com>
Comment 51 Martin Renvoize (ashimema) 2024-04-26 16:12:20 UTC
Created attachment 165677 [details] [review]
Bug 35657: Unit tests for relation accessor additions

This patch adds the unit tests for the new 'assignee' relation accessors
added to Koha::Ticket and Koha::Ticket::Update classes.

Signed-off-by: Paul Derscheid <paulderscheid@gmail.com>
Comment 52 Martin Renvoize (ashimema) 2024-04-26 16:12:23 UTC
Created attachment 165678 [details] [review]
Bug 35657: Unit tests for ticket_update api addition

This patch adds unit tests for the addition of assignee handling in the
ticket update endpoint

Signed-off-by: Paul Derscheid <paulderscheid@gmail.com>
Comment 53 Martin Renvoize (ashimema) 2024-04-26 16:12:26 UTC
Created attachment 165679 [details] [review]
Bug 35657: Unit test for addition to tickets endpoint

This patch adds a unit test for the additional option of now setting the
assignee from the tickets update endpoint.

Signed-off-by: Paul Derscheid <paulderscheid@gmail.com>
Comment 54 Martin Renvoize (ashimema) 2024-04-26 16:14:13 UTC
Unit tests added.. pretty sure you had just missed running updatedatebase as I can't replicate the 500 error.

:)
Comment 55 Martin Renvoize (ashimema) 2024-04-29 17:56:09 UTC
Created attachment 165786 [details] [review]
Bug 35657: Add assignee_id to tickets and ticket_updates

This patch updates the tickets and ticket_updates tables to include a
assignee_id.

Signed-off-by: Paul Derscheid <paulderscheid@gmail.com>
Comment 56 Martin Renvoize (ashimema) 2024-04-29 17:56:12 UTC
Created attachment 165787 [details] [review]
Bug 35657: Schema update

Signed-off-by: Paul Derscheid <paulderscheid@gmail.com>
Comment 57 Martin Renvoize (ashimema) 2024-04-29 17:56:15 UTC
Created attachment 165788 [details] [review]
Bug 35657: Add support for assignee_id to ticket_updates endpoint

This patch adds support for cross-synced ticket.assignee_id updates.

The API allows you to set assignee directly on a ticket or via a
ticket_update. In both cases we store a ticket_update with the fine
details of when and who set the assigee.

Signed-off-by: Paul Derscheid <paulderscheid@gmail.com>
Comment 58 Martin Renvoize (ashimema) 2024-04-29 17:56:18 UTC
Created attachment 165789 [details] [review]
Bug 35657: Add option to set assignee during update

This patch exposes the UI to allow setting assignee from the ticket
update modal.

Test plan
1) Apply the patches and run the database updates
2) Enable catalog concerns - `CatalogConcerns` or `OPACCatalogConcerns`
3) Submit a catalog concern via the OPAC or Staff client biblio page
4) Navigate to the concerns management page 'Cataloging > Catalog
   concerns'
5) Note there is no assignee displayed in the status field for your new
   concern.
6) Click the concern to view it's details
7) Note that in the modal there is now a new 'Change assignee' option
8) Use this new option to search for and assign a librarian to the
   concern.
9) Submit the update
10) Your assignee should now appear in the 'status' data field in the
    table
11) Clicking through to details again, you should see when the assignee
    was set and should also be able to re-assign it

Signed-off-by: Paul Derscheid <paulderscheid@gmail.com>
Comment 59 Martin Renvoize (ashimema) 2024-04-29 17:56:21 UTC
Created attachment 165790 [details] [review]
Bug 35657: Unit tests for relation accessor additions

This patch adds the unit tests for the new 'assignee' relation accessors
added to Koha::Ticket and Koha::Ticket::Update classes.

Signed-off-by: Paul Derscheid <paulderscheid@gmail.com>
Comment 60 Martin Renvoize (ashimema) 2024-04-29 17:56:25 UTC
Created attachment 165791 [details] [review]
Bug 35657: Unit tests for ticket_update api addition

This patch adds unit tests for the addition of assignee handling in the
ticket update endpoint

Signed-off-by: Paul Derscheid <paulderscheid@gmail.com>
Comment 61 Martin Renvoize (ashimema) 2024-04-29 17:56:27 UTC
Created attachment 165792 [details] [review]
Bug 35657: Unit test for addition to tickets endpoint

This patch adds a unit test for the additional option of now setting the
assignee from the tickets update endpoint.

Signed-off-by: Paul Derscheid <paulderscheid@gmail.com>
Comment 62 Martin Renvoize (ashimema) 2024-04-29 17:58:03 UTC
Just another rebase since the prettier stuff got in... would really love to see this make release.
Comment 63 Marcel de Rooy 2024-04-30 12:29:09 UTC
Having another look here
Comment 64 Marcel de Rooy 2024-04-30 12:43:37 UTC
(In reply to Martin Renvoize from comment #54)
> Unit tests added.. pretty sure you had just missed running updatedatebase as
> I can't replicate the 500 error.
> 
> :)

Please explain that to me. There is no dbrev in this patch set !
LOL

Paul: How did you test it ?
Comment 65 Martin Renvoize (ashimema) 2024-04-30 12:59:16 UTC
Created attachment 165878 [details] [review]
Bug 35657: (follow-up) Add missing DB update
Comment 66 Martin Renvoize (ashimema) 2024-04-30 13:00:11 UTC
Can't believe I somehow missed attaching the DB update in the first commit!.. It's there now in the follow-up.. we can squash that of course.. just didn't fancy uploading all the patches again for the rebase.
Comment 67 Paul Derscheid 2024-04-30 13:04:52 UTC
Marcel: just followed the initial test plan (the one marked as important).
Comment 68 Marcel de Rooy 2024-04-30 13:38:50 UTC
Created attachment 165879 [details] [review]
Bug 35657: Add assignee_id to tickets and ticket_updates

This patch updates the tickets and ticket_updates tables to include a
assignee_id.

Signed-off-by: Paul Derscheid <paulderscheid@gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 69 Marcel de Rooy 2024-04-30 13:38:52 UTC
Created attachment 165880 [details] [review]
Bug 35657: Schema update

Signed-off-by: Paul Derscheid <paulderscheid@gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 70 Marcel de Rooy 2024-04-30 13:38:55 UTC
Created attachment 165881 [details] [review]
Bug 35657: Add support for assignee_id to ticket_updates endpoint

This patch adds support for cross-synced ticket.assignee_id updates.

The API allows you to set assignee directly on a ticket or via a
ticket_update. In both cases we store a ticket_update with the fine
details of when and who set the assigee.

Signed-off-by: Paul Derscheid <paulderscheid@gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 71 Marcel de Rooy 2024-04-30 13:38:58 UTC
Created attachment 165882 [details] [review]
Bug 35657: Add option to set assignee during update

This patch exposes the UI to allow setting assignee from the ticket
update modal.

Test plan
1) Apply the patches and run the database updates
2) Enable catalog concerns - `CatalogConcerns` or `OPACCatalogConcerns`
3) Submit a catalog concern via the OPAC or Staff client biblio page
4) Navigate to the concerns management page 'Cataloging > Catalog
   concerns'
5) Note there is no assignee displayed in the status field for your new
   concern.
6) Click the concern to view it's details
7) Note that in the modal there is now a new 'Change assignee' option
8) Use this new option to search for and assign a librarian to the
   concern.
9) Submit the update
10) Your assignee should now appear in the 'status' data field in the
    table
11) Clicking through to details again, you should see when the assignee
    was set and should also be able to re-assign it

Signed-off-by: Paul Derscheid <paulderscheid@gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 72 Marcel de Rooy 2024-04-30 13:39:00 UTC
Created attachment 165883 [details] [review]
Bug 35657: Unit tests for relation accessor additions

This patch adds the unit tests for the new 'assignee' relation accessors
added to Koha::Ticket and Koha::Ticket::Update classes.

Signed-off-by: Paul Derscheid <paulderscheid@gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 73 Marcel de Rooy 2024-04-30 13:39:03 UTC
Created attachment 165884 [details] [review]
Bug 35657: Unit tests for ticket_update api addition

This patch adds unit tests for the addition of assignee handling in the
ticket update endpoint

Signed-off-by: Paul Derscheid <paulderscheid@gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 74 Marcel de Rooy 2024-04-30 13:39:06 UTC
Created attachment 165885 [details] [review]
Bug 35657: Unit test for addition to tickets endpoint

This patch adds a unit test for the additional option of now setting the
assignee from the tickets update endpoint.

Signed-off-by: Paul Derscheid <paulderscheid@gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 75 Marcel de Rooy 2024-04-30 13:39:08 UTC
Created attachment 165886 [details] [review]
Bug 35657: (follow-up) Add missing DB update

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 76 Marcel de Rooy 2024-04-30 13:40:20 UTC
 WARN   t/db_dependent/api/v1/ticket_updates.t
   WARN   tidiness
                The file is less tidy than before (bad/messy lines before: 58, now: 80)

 WARN   t/db_dependent/api/v1/tickets.t
   WARN   tidiness
                The file is less tidy than before (bad/messy lines before: 65, now: 70)

Status is updated on cataloguing/concerns.pl, but not on detail page ?
I cannot add an assignee without changing the status ?
I resolved a concern and wanted to revert its status again. Ending up in ticket status RESO02 but update has ST01 again. See tables below.

I wont block this patch set as part of this tree. But still feel that the functionality is not clear and the forms are not completely bug free.
Add experimental status?

MariaDB [koha_myclone]> select * from tickets;
+----+---------+-------------+---------------------+--------+---------------------+--------+-------------+-------------+---------------------+-----------+
| id | source  | reporter_id | reported_date       | title  | body                | status | assignee_id | resolver_id | resolved_date       | biblio_id |
+----+---------+-------------+---------------------+--------+---------------------+--------+-------------+-------------+---------------------+-----------+
| 34 | catalog |          51 | 2024-04-26 06:51:06 | test   | This is my concern. | ST01   |          30 |          51 | 2024-04-30 13:29:57 |         1 |
| 35 | catalog |          51 | 2024-04-26 06:52:50 | Second | Test                | RESO2  |        NULL |          51 | 2024-04-26 07:14:14 |         1 |
+----+---------+-------------+---------------------+--------+---------------------+--------+-------------+-------------+---------------------+-----------+
MariaDB [koha_myclone]> select * from ticket_updates;
+----+-----------+---------+-------------+--------+---------------------+----------+--------+
| id | ticket_id | user_id | assignee_id | public | date                | message  | status |
+----+-----------+---------+-------------+--------+---------------------+----------+--------+
| 13 |        34 |      51 |        NULL |      0 | 2024-04-26 06:53:04 | Update 1 | NULL   |
| 14 |        34 |      51 |        NULL |      0 | 2024-04-26 06:54:36 |          | ST01   |
| 22 |        35 |      51 |        NULL |      0 | 2024-04-26 07:14:14 |          | RESO2  |
| 32 |        34 |      51 |          19 |      0 | 2024-04-30 13:24:34 |          | ST01   |
| 33 |        34 |      51 |          30 |      0 | 2024-04-30 13:29:27 |          | ST01   |
| 34 |        34 |      51 |        NULL |      0 | 2024-04-30 13:29:57 |          | RESO2  |
| 35 |        34 |      51 |          30 |      0 | 2024-04-30 13:30:09 |          | ST01   |
+----+-----------+---------+-------------+--------+---------------------+----------+--------+

Passed QA
Comment 77 Katrin Fischer 2024-04-30 15:11:54 UTC
I can't do more for today, but I will still review this for 24.05 end of the week.
Comment 78 Martin Renvoize (ashimema) 2024-04-30 15:22:52 UTC
I'd be more than happy with experimental and I will refine as bugfixes during the first month of the next cycle if that works for people?
Comment 79 Martin Renvoize (ashimema) 2024-05-02 12:17:58 UTC
Created attachment 166067 [details] [review]
Bug 35657: (follow-up) Placeholders should be translatable

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 80 Katrin Fischer 2024-05-02 13:28:44 UTC
Pushed for 24.05!

Well done everyone, thank you!
Comment 81 Fridolin Somers 2024-05-24 12:50:43 UTC
Not backported to 23.11.x