Red Hat Bugzilla – Bug 996165
[RFE] Notify system owner when a system is loaned or returned
Last modified: 2018-03-19 00:19:17 EDT
Description of problem:
Returned System loans should send a messages to the Request Tracker (RT) when system loans are set and released. Currently if users set or release loans there is no Request Tracker notification of granting or returning system loans.
Loan tracking is currently a manual task and often results in tickets being held open far longer than required. Requests require the manual effort of the owner of the ticket checking the status of the loan in beaker then updating the RT. Adding this feature would make the loan process far more efficient.
To implement it would require adding a field to the loan dialog window (RT ID#) which would allow the ability to collect the RT ID# of the requested loan. When filled in it would trigger the sending of an e-mail updating the RT with a notice (with a canned reminder to return the system as soon as possible) that the loan had been granted. Once the loan has been set, the action of releasing it would trigger a second e-mail updating the RT with a notice that the system was returned.
Version-Release number of selected component (if applicable):
Version - 0.14.1
Beaker will not be directly integrated with an external service like Request Tracker. The improved Access Policies mechanism currently being implemented (http://beaker-project.org/dev/proposals/access-policies-for-systems.html#proposal-access-policies) should allow an independent service to manipulate Beaker loans on behalf of the system owner (as well as updating an external service like RT of the change).
Beaker can currently send e-mail notices. I don't see any integration work that needs to be done to complete this request. Do you see any need for additional work to integrate the two products?
We'd have to add the storage for the ticket ID, configuration settings for where to send the email, formatting code to create the email. It's all specific to the way a particular Beaker installation is used, and out of scope for the upstream project.
However, while we won't add direct integration, feel free to contact the Beaker development list about how we could help improve the situation without altering Beaker itself. For example, it seems to me it should be possible to write a cron job that monitors the system history for loan grants and returns (we'd just have to keep an eye on the query used to ensure it didn't hit the database server too hard).
This may lead to the definition of a new "supported query", which would be a separate RFE (but one that's easy to add - it's just an SQL file and a test to ensure it continues to return the expected answer as Beaker evolves).
Note that there's also a longer term plan to have a request management capability in Beaker itself, for both group membership and system loans. However, there's no ETA for that, so helping to define an external cron job to update a ticketing system seems like a better near term approach.
Arthur clarified his request to indicate that simply emailing the system owner when the system was loaned or returned would suffice. That's a different question from adding a custom issue tracker field, so retitling and reopening this.
Now that we have notification preferences, we could add this as a new notification type which will default to *off* for all users. Users could opt into it as desired.
Also, I assume we would not want to send the notification when the user themselves issues the loan -- this would only be for the case where the system permissions allow other people to lend/borrow the system. We notify the owner when somebody *else* has loaned or returned the system.
Tested this in my local environment with: beaker-server 25.0.git.203.08fe7cd7a
* I've created a new user rjoost
* all systems are owned by admin
* preferences for admin have checked: System automatically marked broken
Scenario 1: Owner of the system performs a loan/return action will not be notified of it's own actions.
1) Logged into the WebUI as admin
2) Under loan, lend the system to user 'rjoost'
3) No mail has been sent to admin
Scenario 2: Borrower returns system to owner which wants to be notified
1) Logged into the WebUI as rjoost
2) Under loan click "Return Loan"
3) Owner 'admin' received an email with "System beaker-test-vm1 loan returned" as a subject.
Beaker 25.0 has been released.
Release notes are available upstream: https://beaker-project.org/docs/whats-new/release-25.html