Completes the work from #9207.
on_hold_duration column from the tasks tableStill waiting on old-style holds to expire. Exactly 100 remaining!
select count(*)
, type
from tasks
where on_hold_duration is not null
and status not in ('cancelled', 'completed')
and updated_at = placed_on_hold_at
group by 2
order by 1 desc;
Count | Type
--- | ---
81 | ColocatedTask
18 | NoShowHearingTask
1 | HearingAdminActionOtherTask
Of the 84 open non-NoShowHearingTask tasks that have at one time been placed on an old-style hold, 29 have passed their hold expiration date. 28 of those 29 correctly have the "in_progress" status. I'm guessing the other task (HearingAdminActionOtherTask ID 201617) has not had its status updated because the user it is assigned to (ID 1955) has not logged in to Caseflow since 23 May 2019 and the task has not been picked up by the code in GenericQueue where the task's status would be updated. I think we should manually update the status of this task so that it can be acted on by members of the hearings management branch (the organization to which the parent task is assigned).
In addition, I think we should null out the "on_hold_duration" columns for all 29 tasks so that we don't prematurely take those tasks off hold if folks create child tasks from those tasks (one of the bugs mentioned in the tech spec--another bug predicted the issue we are in with HearingAdminActionOtherTask ID 201617 being stuck because somebody hasn't logged in to Caseflow for a long time!).
select id
, type
, status
, placed_on_hold_at + on_hold_duration * interval '1 day' as old_style_hold_expiration
, placed_on_hold_at
, on_hold_duration
from tasks
where on_hold_duration is not null
and status not in ('cancelled', 'completed')
and type <> 'NoShowHearingTask'
order by old_style_hold_expiration asc;
HearingAdminActionOtherTask ID 201617 to "in_progress"NoShowHearingTasks that using the old style holdsCurrently have 53 tasks on hold using the old-style holds:
select id
, type
, status
, placed_on_hold_at + on_hold_duration * interval '1 day' as old_style_hold_expiration
, placed_on_hold_at
, on_hold_duration
from tasks
where on_hold_duration is not null
and status = 'on_hold'
order by old_style_hold_expiration asc;
Down to 15 tasks on hold using the old style hold. Revisit this ticket in mid-September after nearly all old-style holds have expired.

Down to 6 tasks on hold using the old style hold.

1 | ||||
2 | ||||||
3 | ||||
5 | |
8 |
Fields in Tasks table, placed_on_hold_at and on_hold_duration, switched to new system documented in new wiki (https://github.com/department-of-veterans-affairs/caseflow/wiki/Timed-Tasks).
Begin by ignoring on_hold_duration, then remove it later. placed_on_hold_at is still useful (updated when status is updated to on_hold - while imprecise, still often useful).
Probably could delete some tests.
If we wait to do this until after Nov 13, we don't have to worry about old-style hold. If we want to make transition before then, we will need to create new-style holds for old holds.
There are no more tasks on hold with the old-style hold! https://caseflow-looker.va.gov/sql/7vrsydq8xs2dd2
Most helpful comment
There are no more tasks on hold with the old-style hold! https://caseflow-looker.va.gov/sql/7vrsydq8xs2dd2