I am writing an python extract script to extract all projects and tasks from a portfolio with more than 50 projects and over 1000 tasks. This extract will run daily and do an incremental load of all project’s tasks in database table (which means one initial run to backfill all tasks and then daily extract of tasks modified since previous day) . My problem is if a task is deleted from one of the project and I want to show all tasks present today in project, the database will still have the task from previous day extract and map it to project on the basis of project id.
Is there any task or project property that I can include in api call to flag if task is deleted from the project?
I do a similar daily extract, storing the task details and stories so I can pull reports based on certain internal timestamps.
One thing I found super helpful was to create a metadata index of the tasks I’ve stored this way. It wouldn’t be too hard to add a boolean flag for whether or not it’s current. Then roll through the metadata list, polling the API for the known tasks to make sure they’re still available. (I assume that once a task is deleted, it can no longer be pulled up in the API. I may be wrong there.)
If the task is still active and you’re just looking for moving out of or between projects; I would look for stories relating to “So and so added to [project]” or “So and so removed from [project]” (I forget the exact wording.)
I think the best method for you is to subscribe to “webhook”, and get a call when a task is deleted.
You will be able to update your local copy immediately.
You can also use webhook to be notified of all changes, and you will never need to query api again, your local copy will always be in “sync”.