Skip to content

Legacy Appeals tied to Non‐SSC AVLJs

Michael Beard edited this page Aug 6, 2024 · 21 revisions

Overview

The ReturnLegacyAppealsToBoard job automates the process of identifying and moving legacy appeals tied to non-SSC AVLJs. It operates on a regular schedule to ensure appeals are properly managed and moved back to the Board. This process ensures appeals are handled efficiently and in accordance with set priorities. This job identifies all Legacy appeals tied to non-SSC AVLJs, moves these appeals to the appropriate location (location 63) for further processing, updates relevant database records, and sends notifications upon completion. This job runs at a specified interval as determined by system settings, or triggered manually when needed. It generates a CSV report listing the appeals that were moved in the last 48 hours.

Non-SSC:

  • Non-Senior Supervisory Counsel

AVLJ:

  • Administrative Veteran Law Judge (AVLJ) is a judge who presides over the appeals process within the Veterans Affairs system

Navigation

To run this job, you must have the appropriate permissions within the Caseflow system. Typically, this is a role assigned to Admin or authorized personnel with access to the Caseflow demo environment.

  • Log into Caseflow
  • Navigate to [demo environment url]/acd-controls/test
  • Scroll to the Case Movement section
  • Click the Run ReturnLegacyAppealsToBoard job button

Post-Run Actions:

  • Once the job runs, it updates the database with completion status and sends a Slack notification to the relevant channels.
  • It generates a CSV report listing the appeals that were moved in the last 48 hours.

Verification of Appeals Movement

Check Banner:

  • Ensure the banner confirms the job completion.

Verify Appeals:

  • Click on the "Download Loc 63 Appeals Last 48 hrs CSV" button
  • Open the downloaded CSV file to verify the list of appeals that were moved

Implementation Details

When the ReturnLegacyAppealsToBoardJob is triggered, the following sequence of operations is performed:

  • Record Creation: A new record is created in the returned_appeal_jobs table.
  • Appeals Identification: All appeals tied to non-SSC AVLJs are found and grouped by AVLJ.
  • Appeal Sorting: Appeals are sorted by priority and then by date (BFD19).
  • Appeal Selection: Appeals are selected based on the following criteria:
    1. Two oldest priority appeals.
    2. If fewer than two priority appeals are found, selects the oldest non-priority appeals.
  • Appeal Movement: Selected appeals are moved to location 63.
  • Completion Actions: The job updates the database record with the results, including stats and a list of appeals moved.
  • Notification: A Slack message is sent with the job summary to:
    1. prod - #appeals-job-alerts
    2. prodtest - #appeals-prodtest-alerts
    3. uat - "#appeals-uat-alerts"
    4. For local and demo environments, the message is pretty printed to Rails Logs
  • Error Handling: If an error occurs, it is logged, and a Slack message is sent detailing the error.

TMR Section

When the ReturnLegacyAppealsToBoard is triggered the following happens:

  • A database record is created in the returned_appeal_jobs database table

  • All appeals tied to non-SSC AVLJs are found

  • If no appeals are found:

    1. The record created is updated to have a completed date.
    2. A Slack message is sent to the default Slack channels.
      1. For local and demo, the record created is updated with the Slack message and is pretty printed in Rails Logs.
  • Appeals are grouped by non-SSC AVLJ, then sorted in this order:

    1. Priority
    2. BFD19
  1. Create an empty array to hold the BRIEFF.BFKEY of appeals to be moved (appeals_to_move)
  2. For each non-SSC AVLJ
    1. Find 2 oldest priority appeals
      1. If found 2
        1. add the 2 BRIEFF.BFKEY values to appeals_to_move
      2. else if found 1
        1. add the BRIEFF.BFKEY value to appeals_to_move
        2. Find the oldest non-priority appeal
        3. add the BRIEFF.BFKEY value to appeals_to_move
      3. else if found 0
        1. Find the 2 oldest non-priority appeal
        2. add the 2 BRIEFF.BFKEY values to appeals_to_move
      4. Go to next non-SSC AVLJ
  3. For all BRIEFF.BFKEY of appeals to be moved (appeals_to_move) move those appeals to location 63
    1. use VACOLS::Case.batch_update_vacols_location('63', appeals_to_move)
  4. After appeals have been moved
    1. the record created in Step 1 is updated to have an end date
    2. all BRIEFF.BFKEY of appeals to be moved (appeals_to_move) are put into the returned_appeals column of the record created in Step 1
    3. stats are recorded for the record created in Step 1
      1. Number of priority appeals returned to the board
      2. Number of non-priority appeals returned to the board
      3. Number of remaining priority appeals tied to non-SSC AVLJs
      4. Number of remaining non-priority appeals to non-SSC AVLJs
      5. List of non-SSC AVLJs that appeals were moved from to location '63'
        1. Keys of the hash the holds "Appeals should be grouped by non-SSC AVLJ"
    4. An informative Slack message is sent to the default Slack channels
      1. For local and demo the record created in Step 1 has its stats column updated with the Slack message as one of the json properties
  5. If an error occurs during the job
    1. the record created in Step 1 is updated to have an errored date
    2. The error is included as a property in the stats column for the record created in Step 1
    3. a Slack message is sent to the default Slack channels
      1. For local and demo the record created in Step 1 has its stats column updated with the Slack message as one of the json properties
    4. Error is logged using CaseflowJob.log_error
    5. EXIT POINT
  6. Ensure that metrics are recorded for the job before it exits using CaseflowJob.metrics_service_report_runtime
Clone this wiki locally