Bug 996165 - [RFE] Notify system owner when a system is loaned or returned
[RFE] Notify system owner when a system is loaned or returned
Product: Beaker
Classification: Community
Component: general (Show other bugs)
All All
medium Severity medium (vote)
: 25.0
: ---
Assigned To: Dan Callaghan
Roman Joost
: FutureFeature, Patch, Reopened
Depends On:
  Show dependency treegraph
Reported: 2013-08-12 10:35 EDT by Arthur Benoit
Modified: 2018-03-19 00:19 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2018-03-19 00:19:17 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Arthur Benoit 2013-08-12 10:35:50 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
Comment 2 Nick Coghlan 2013-08-12 16:52:12 EDT
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).
Comment 3 Arthur Benoit 2013-08-12 17:06:07 EDT
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?

Comment 4 Nick Coghlan 2013-08-12 17:26:13 EDT
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).
Comment 5 Nick Coghlan 2013-08-12 17:28:38 EDT
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.
Comment 6 Nick Coghlan 2013-08-14 15:57:20 EDT
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.
Comment 7 Dan Callaghan 2017-12-21 00:43:40 EST
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.
Comment 8 Dan Callaghan 2017-12-21 01:41:47 EST
Comment 10 Roman Joost 2018-02-12 00:59:12 EST
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.
Comment 11 Roman Joost 2018-03-19 00:19:17 EDT
Beaker 25.0 has been released.

Release notes are available upstream: https://beaker-project.org/docs/whats-new/release-25.html

Note You need to log in before you can comment on or make changes to this bug.