workforce-scripts
workforce-scripts copied to clipboard
How to migrate completed assignments?
Hi, I was using migrate_assignments.py to migrate assignments from the classic project and the new project during the migration I encountered an error - "Assignments not migrated successfully. Unknown error". When I checked the new project I found that only the Assigned and In Progress assignments got migrated. While going through the Migrate a Classic Workforce project blog i have found that we can optionally provide and attribute called where “status IN (0,1,2)”. Refer to the below screenshot for the same.
.
I just wanted to what is the status code we need to provide for migrating the completed assignments or how we can migrate the completed assignments.?
Any help would be really appreciated.
Thanks Ayush
You can find the Workforce Classic Schema here: https://doc.arcgis.com/en/workforce/android-phone/help/workforce-schema-classic.htm
Completed assignments are 3
and cancelled ones are 6
so just change your where clause to status IN (3, 6)
if you want to migrate those. The default where clause, which does everything except completed and cancelled assignments can be found here:
https://github.com/Esri/workforce-scripts/blob/afda1af0af97630fd7fdb543871666d17610441c/scripts/migrate_assignments.py#L255