-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Determine what to do with children of cancelled tasks assigned to inactive users #12505
Comments
Throwing a 2 at this after scoping it to planning out the work needed. |
Resolves #12394 ### Description Reassigns all tasks assigned to a user ### Acceptance Criteria - [ ] Fails when original tasks are not in the correct state - [ ] Leaves all reassigned tasks in the correct state ### Testing Plan Users to test: - BVAAABSHIRE (Parent task is RootTask assigned to Bva) - QR_USER (Parent task assigned to `Organization` NOT using automatic child task assignment) - CSS_ID1 (Parent task assigned to `Organization` using automatic child task assignment) - BVASCASPER1 (Parent task assigned to `User` - `AttorneyTask`) _All of this was done off of a fresh `make reset`_ #### BVAAABSHIRE 1. Check out the state of the user's current tasks ```ruby user = User.find_by(css_id: "BVAAABSHIRE") user.update_status!(Constants.USER_STATUSES.inactive) JudgeTeam.for_judge(user).non_admins.each do |atty| OrganizationsUser.add_user_to_organization(user, JudgeTeam.first) end JudgeQualityReviewTask.create!(parent: QualityReviewTask.active.last, assigned_to: user, appeal: QualityReviewTask.active.last.appeal) appeals = Task.open.where(assigned_to: user).order(:type, :status).map(&:appeal) task_trees = appeals.map do |appeal| appeal.structure_render(:assigned_to_id, :status) end.each { |tree| puts tree } # assigned JudgeAssignTask # Appeal 114 [assigned_to_id, status] # └── RootTask 4, on_hold # ├── DistributionTask 4, completed # └── JudgeAssignTask 3, assigned # assigned JudgeDecisionReviewTask with completed AttorneyTask # Appeal 50 [assigned_to_id, status] # └── RootTask 4, on_hold # └── JudgeDecisionReviewTask 3, assigned # └── AttorneyTask 1, completed # on hold JudgeDecisionReviewTask with downstream children # Appeal 111 [assigned_to_id, status] # └── RootTask 4, on_hold # └── JudgeDecisionReviewTask 3, on_hold # └── AttorneyTask 1, on_hold # └── TranslationColocatedTask 10, on_hold # └── TranslationTask 10, assigned # on hold JudgeDecisionReviewTask # Appeal 60 [assigned_to_id, status] # └── RootTask 4, on_hold # └── JudgeDecisionReviewTask 3, on_hold # └── AttorneyTask 1, in_progress # JudgeQualityReviewTask (parent assigned to user) # Appeal 17 [assigned_to_id, status] # └── RootTask 4, on_hold # ├── DistributionTask 4, assigned # ├── JudgeDecisionReviewTask 53, completed # │ └── AttorneyTask 54, completed # └── QualityReviewTask 11, on_hold # └── QualityReviewTask 46, on_hold # └── JudgeQualityReviewTask 3, assigned ``` 2. Rake! ```bash bundle exec rake tasks:reassign_from_user[3,false] ``` 3. Check the state of the reassigned tasks ```ruby Task.open.where(assigned_to: user).count # => 0 appeals.map do |appeal| appeal.structure_render(:assigned_to_id, :status) end.each { |tree| puts tree } # assigned JudgeAssignTask # Appeal 114 [assigned_to_id, status] # └── RootTask 4, on_hold # ├── DistributionTask 4, completed # ├── JudgeAssignTask 3, cancelled # └── DistributionTask 4, assigned # assigned JudgeDecisionReviewTask with completed AttorneyTask # Appeal 50 [assigned_to_id, status] # └── RootTask 4, on_hold # ├── JudgeDecisionReviewTask 3, cancelled # └── JudgeDecisionReviewTask 82, assigned # └── AttorneyTask 1, completed # on hold JudgeDecisionReviewTask with downstream children # Appeal 111 [assigned_to_id, status] # └── RootTask 4, on_hold # ├── JudgeDecisionReviewTask 3, cancelled # └── JudgeDecisionReviewTask 82, on_hold # └── AttorneyTask 1, on_hold # └── TranslationColocatedTask 10, on_hold # └── TranslationTask 10, assigned # on hold JudgeDecisionReviewTask # Appeal 60 [assigned_to_id, status] # └── RootTask 4, on_hold # ├── JudgeDecisionReviewTask 3, cancelled # └── JudgeDecisionReviewTask 82, on_hold # └── AttorneyTask 1, in_progress # JudgeQualityReviewTask (parent assigned to user) # Appeal 17 [assigned_to_id, status] # └── RootTask 4, on_hold # ├── DistributionTask 4, assigned # ├── JudgeDecisionReviewTask 53, completed # │ └── AttorneyTask 54, completed # └── QualityReviewTask 11, on_hold # └── QualityReviewTask 46, assigned # └── JudgeQualityReviewTask 3, cancelled # ✅ Judge tasks assigned to user are cancelled # ✅ Judge assign tasks are put back into distribution # ✅ new JudgeDecisionReviewTasks are created for another judge # ✅ AttorneyTasks are under their new parent # ✅ JudgeQualityReviewTask is cancelled with an "assigned" parent ``` #### QR_USER 1. Check out the state of the user's current tasks ```ruby user = User.find_by(css_id: "QR_USER") appeals = Task.open.where(assigned_to: user).order(:type, :status).map(&:appeal) appeals.map do |appeal| appeal.structure_render(:assigned_to_id, :status) end.each { |tree| puts tree } # Appeal 17 [assigned_to_id, status] # └── RootTask 4, on_hold # ├── DistributionTask 4, assigned # ├── JudgeDecisionReviewTask 53, completed # │ └── AttorneyTask 54, completed # └── QualityReviewTask 11, on_hold # └── QualityReviewTask 46, assigned ``` 2. Rake! ```bash bundle exec rake tasks:reassign_from_user[46,false] ``` 3. Check the state of the reassigned tasks ```ruby Task.open.where(assigned_to: user).count # => 0 appeals.map do |appeal| appeal.structure_render(:assigned_to_id, :status) end.each { |tree| puts tree } # Appeal 17 [assigned_to_id, status] # └── RootTask 4, on_hold # ├── DistributionTask 4, assigned # ├── JudgeDecisionReviewTask 53, completed # │ └── AttorneyTask 54, completed # └── QualityReviewTask 11, assigned # └── QualityReviewTask 46, cancelled # ✅ Tasks assigned to user are cancelled # ✅ Organization task is reopened for admin to assign ``` #### CSS_ID1 1. Check out the state of the user's current tasks ```ruby user = User.find_by(css_id: "CSS_ID1") user.update_status!(Constants.USER_STATUSES.inactive) org_tasks = Task.open.where(assigned_to: user).order(:type, :status).map(&:parent) org_tasks.map do |parent| parent.structure_render(:assigned_to_id, :status) end.each { |tree| puts tree } # AddressVerificationColocatedTask 5, on_hold # └── AddressVerificationColocatedTask 15, assigned # MissingRecordsColocatedTask 5, on_hold # └── MissingRecordsColocatedTask 15, assigned # StayedAppealColocatedTask 5, on_hold # └── StayedAppealColocatedTask 15, assigned ``` 2. Rake! ```bash bundle exec rake tasks:reassign_from_user[15,false] ``` 3. Check the state of the reassigned tasks ```ruby Task.open.where(assigned_to: user).count # => 0 org_tasks.map do |parent| parent.structure_render(:assigned_to_id, :status) end.each { |tree| puts tree } # AddressVerificationColocatedTask 5, on_hold # ├── AddressVerificationColocatedTask 15, cancelled # └── AddressVerificationColocatedTask 16, assigned # MissingRecordsColocatedTask 5, on_hold # ├── MissingRecordsColocatedTask 15, cancelled # └── MissingRecordsColocatedTask 16, assigned # StayedAppealColocatedTask 5, on_hold # ├── StayedAppealColocatedTask 15, cancelled # └── StayedAppealColocatedTask 16, assigned # ✅ Tasks assigned to user are cancelled # ✅ Organization task is still on hold # ✅ Another task of the same type has been opened for other colocated team members ``` #### BVASCASPER1 1. Check out the state of the user's current tasks ```ruby user = User.find_by(css_id: "BVASCASPER1") appeals = Task.open.where(assigned_to: user).order(:type, :status).map(&:appeal) appeals.map do |appeal| appeal.structure_render(:assigned_to_id, :status) end.each { |tree| puts tree } # in progress Task # Appeal 60 [assigned_to_id, status] # └── RootTask 4, on_hold # ├── JudgeDecisionReviewTask 3, cancelled # └── JudgeDecisionReviewTask 82, on_hold # └── AttorneyTask 1, in_progress # on hold Task # Appeal 96 [assigned_to_id, status] # └── RootTask 4, on_hold # ├── JudgeDecisionReviewTask 3, cancelled # └── JudgeDecisionReviewTask 82, on_hold # └── AttorneyTask 1, on_hold # └── HearingClarificationColocatedTask 5, on_hold # └── HearingClarificationColocatedTask 16, assigned ``` 2. Rake! ```bash bundle exec rake tasks:reassign_from_user[1,false] ``` 3. Check the state of the reassigned tasks ```ruby Task.open.where(assigned_to: user).count # => 0 appeals.map do |appeal| appeal.structure_render(:assigned_to_id, :status) end.each { |tree| puts tree } # in progress Task # Appeal 60 [assigned_to_id, status] # └── RootTask 4, on_hold # ├── JudgeDecisionReviewTask 3, cancelled # │ └── AttorneyTask 1, cancelled # └── JudgeAssignTask 3, assigned # on hold Task # Appeal 96 [assigned_to_id, status] # └── RootTask 4, on_hold # ├── JudgeDecisionReviewTask 3, cancelled # │ └── AttorneyTask 1, cancelled # │ └── HearingClarificationColocatedTask 5, on_hold # │ └── HearingClarificationColocatedTask 16, assigned # └── JudgeAssignTask 3, assigned # ✅ AttorneyTasks and JudgeDecisionReviewTasks are cancelled # ✅ New JudgeAssignTask created ``` TODO: - [x] Fix `JudgeDecisionReviewTask` reassign - [x] Add test instructions for other users - [x] Reassess tasks with parents assigned to other users - [x] Determine what to do with downstream children (ticketed #12505)
Can you confirm the below are the only parent/child task associations we will run into in this case? “PARENT TASK”, “CHILD TASK” |
Here are the scenarios and the number of times the scenario occurs (investigation)
An attorney leaves the board and the following tasks are cancelled, leaving orphaned child tasks
A QualityReview team member leaves the board and the following tasks are cancelled, leaving orphaned child tasks
A judge leaves the board and the following tasks are cancelled, leaving orphaned child tasks
A LitigationSupport team member leaves the board and the following tasks are cancelled, leaving orphaned child tasks
|
Suggestions
|
@hschallhorn can you explain what you mean by the first option "Move the orphaned child tasks to the parent task"? My moving it to the parent task do you mean moving it to the user that has that parent task? |
Here is an example! Currently: Say an attorney leaves the board and there is a Proposed: "Move the orphaned child tasks to the parent task" means we will make that Task treesBEFORE REASSIGN Appeal 17635 (direct_review) STATUS ASGN_TO
└── RootTask on_hold Bva
└── BvaDispatchTask on_hold BvaDispatch
└── BvaDispatchTask on_hold VACOWILLIW
└── JudgeDispatchReturnTask on_hold VACOCARACA
└── AttorneyDispatchReturnTask on_hold VACOPARKT
└── OtherColocatedTask on_hold Colocated
└── OtherColocatedTask assigned VACOAUSTIT1 AFTER CANCELLING (CURRENT) Appeal 17635 (direct_review) STATUS ASGN_TO
└── RootTask on_hold Bva
└── BvaDispatchTask on_hold BvaDispatch
└── BvaDispatchTask on_hold VACOWILLIW
└── JudgeDispatchReturnTask assigned VACOCARACA
└── AttorneyDispatchReturnTask cancelled VACOPARKT
└── OtherColocatedTask on_hold Colocated <- Orphaned
└── OtherColocatedTask assigned VACOAUSTIT1 <- tasks AFTER CANCELLING (PROPOSED) Appeal 17635 (direct_review) STATUS ASGN_TO
└── RootTask on_hold Bva
└── BvaDispatchTask on_hold BvaDispatch
└── BvaDispatchTask on_hold VACOWILLIW
└── JudgeDispatchReturnTask on_hold VACOCARACA
├── AttorneyDispatchReturnTask cancelled VACOPARKT
└── OtherColocatedTask on_hold Colocated
└── OtherColocatedTask assigned VACOAUSTIT1 |
@hschallhorn regrets, realized I did not add the Boards thoughts to this ticket. They agree with the first two suggestions and would like for the colocated tasks to remain active even if the cases is assigned back to distribution. |
@hschallhorn please let me know if further definition is needed here. |
The open question is where these should move to. If they remain where they are, the case could be dispatched without the work being completed. If the move to under the distribution task, they will block distribution. |
Sent email to the Board inquire where the colocated tasks should move to. |
What is the concern of having the colocated tasks block distribution? The Board feels this might be the better option since the attorney and/or VLJ would not be able to work the case until those are completed anyway, but they will confirm this with the DVCs. |
That is true! If that's what the board would like moving forward, that works for me! Happy to finally have a resolution for this |
Resolution:
|
Spun out of #12483.
Some slack chatter.
In some scenarios, when we "reassign" tasks of an inactive user, some tasks are merely cancelled to be reassigned manually by a judge, team admin, quality reviewer, bva dispatch team member, etc. On occasion these tasks will have children that become orphaned due to their parent being cancelled. In some scenarios, these children can be moved to their new parent. In other scenarios, these downstream children should be cancelled.
This ticket exists to determine which path to take in which situation.
AC
The text was updated successfully, but these errors were encountered: