workforce-scripts icon indicating copy to clipboard operation
workforce-scripts copied to clipboard

How to migrate completed assignments?

Open Ayushyadav19 opened this issue 2 years ago • 1 comments

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.

image.

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

Ayushyadav19 avatar Jan 27 '23 06:01 Ayushyadav19

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

apulverizer avatar Feb 06 '23 01:02 apulverizer