VRR SOP - department-of-veterans-affairs/caseflow GitHub Wiki

Description

From related SNOW ticket: APPEALS-4106 - Manually Complete VeteranRecordRequest INC22451913:

Caseflow is automatically creating VeteranRecordRequest tasks for the business line VRE. This is incorrect as VRE now uses VBMS and we don't need to get the records manually. There are currently 136 active VRE record request tasks that should be set to completed or cancelled. The tasks can be found in the database with the query SELECT * from tasks WHERE type='VeteranRecordRequest' AND status in ('assigned', 'on_hold', 'in_progress') AND assigned_to_id=220;

  • Note: As of this writing, the root cause of these errant tasks being created has not yet been addressed in the application code. See related Slack thread.

  • Introduces rake task remediations:cancel_vrr_tasks_open_for_vre, which identifies any currently open VeteranRecordReqeust Tasks that are assigned to the "Veteran Readiness and Employment" BusinessLine and cancels them and their open descendant tasks.

From the Rails console, run the following query and note the result:

sudo su -
source /opt/caseflow-certification/caseflow-certification_env.sh; cd /opt/caseflow-certification/src; bin/rails c

RequestStore[:current_user] = User.system_user


vre_business_line =  
  BusinessLine.where(name: Constants::BENEFIT_TYPES["voc_rehab"])
  
final_count_of_open_vrr_tasks = 
  VeteranRecordRequest.open.where(assigned_to: vre_business_line).count

final_count_of_cancelled_vrr_tasks = 
  VeteranRecordRequest.cancelled.where(assigned_to: vre_business_line).count

Run rake task to cancel existing open VRR tasks for VRE

Exit the rails console and run rake task from AWS terminal:

bin/rake remediations:cancel_vrr_tasks_open_for_vre

Find final count of existing open and cancelled VRR tasks for VRE

Reopen the Rails console, run the following query and note the result:

sudo su -
source /opt/caseflow-certification/caseflow-certification_env.sh; cd /opt/caseflow-certification/src; bin/rails c

RequestStore[:current_user] = User.system_user


vre_business_line =  
  BusinessLine.where(name: Constants::BENEFIT_TYPES["voc_rehab"])
  
final_count_of_open_vrr_tasks = 
  VeteranRecordRequest.open.where(assigned_to: vre_business_line).count

final_count_of_cancelled_vrr_tasks = 
  VeteranRecordRequest.cancelled.where(assigned_to: vre_business_line).count

The final count of open VRR tasks for VRE should now be 0, and the final count of cancelled VRR tasks for VRE should be incremented by the initial count of the final_count_of_open_vrr_tasks