Project Online ReST API fetch recently updated tasks, assignments

%3CLINGO-SUB%20id%3D%22lingo-sub-2139963%22%20slang%3D%22en-US%22%3EProject%20Online%20ReST%20API%20fetch%20recently%20updated%20tasks%2C%20assignments%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2139963%22%20slang%3D%22en-US%22%3E%3CP%3EHello%20Everyone%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20want%20to%20fetch%20recently%20updated%20tasks%2C%20assignments%20from%20Project%20Online.%20Currently%20I've%20included%20a%20filter%20to%20fetch%20projects%20and%20related%20tasks%2C%20assignments%20by%20published%20date%20time.%20But%20when%20I%20execute%20it%20also%20includes%20newly%20created%20project%20and%20related%20tasks%2C%20assignments.%20Project%2C%20task%2C%20assignment%20creation%20module%20executes%20before%20update%20module.%20How%20this%20scenario%20can%20be%20handle%3F%20Is%20it%20possible%20to%20create%20a%20flag%20in%20the%20Project%20Online%20that%20will%20auto-update%20to%201%20whenever%20a%20user%20makes%20any%20manual%20changes%20in%20the%20task%2C%20assignment%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20%26amp%3B%20Regards%2C%3C%2FP%3E%3CP%3ERohan%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2139963%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAPI%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EOnline%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EProject%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EProject%20Server%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2142243%22%20slang%3D%22en-US%22%3ERe%3A%20Project%20Online%20ReST%20API%20fetch%20recently%20updated%20tasks%2C%20assignments%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2142243%22%20slang%3D%22en-US%22%3E%3CP%3EHello%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F939454%22%20target%3D%22_blank%22%3E%40rohanw24%3C%2FA%3E%2C%3C%2FP%3E%0A%3CP%3ECan%20you%20used%20the%20created%20date%20to%20filter%20out%20newly%20created%20projects%20%2F%20tasks%20%2F%20assignments%3F%3C%2FP%3E%0A%3CP%3EPaul%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2171489%22%20slang%3D%22en-US%22%3ERe%3A%20Project%20Online%20ReST%20API%20fetch%20recently%20updated%20tasks%2C%20assignments%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2171489%22%20slang%3D%22en-US%22%3E%3CP%20data-unlink%3D%22true%22%3EHi%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F2675%22%20target%3D%22_blank%22%3E%40Paul%20Mather%3C%2FA%3E%2C%3CBR%20%2F%3E%3CBR%20%2F%3EWhile%20filtering%20projects%20I'm%20using%20this%20API%20uri%3A%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3Ehttps%3A%2F%2Fexample.sharepoint.com%2Fsites%2Fpwa%2F_api%2FProjectServer%2FProjects%3F%24filter%3DlastSavedDate%20%20gt%20%24DateCriteria%26amp%3BisCheckedOut%3Dtrue%3C%2FCODE%3E%3C%2FPRE%3E%3CP%20data-unlink%3D%22true%22%3E%3CBR%20%2F%3E%24DateCriteria%20will%20contain%20timestamp%20when%20the%20application%20was%20successfully%20executed.%20So%20that%20it%20will%20consider%20only%20those%20projects%20that%20were%20saved%20after%20provided%20%24DateCriteria%20and%20which%20are%20checked%20out.%20Could%20you%20please%20let%20me%20know%20your%20thoughts%20on%20this%20logic%3F%3CBR%20%2F%3E%3CBR%20%2F%3EThanks%20%26amp%3B%20Regards%2C%3CBR%20%2F%3ERohan%3C%2FP%3E%3C%2FLINGO-BODY%3E
Contributor

Hello Everyone,

 

I want to fetch recently updated tasks, assignments from Project Online. Currently I've included a filter to fetch projects and related tasks, assignments by published date time. But when I execute it also includes newly created project and related tasks, assignments. Project, task, assignment creation module executes before update module. How this scenario can be handle? Is it possible to create a flag in the Project Online that will auto-update to 1 whenever a user makes any manual changes in the task, assignment?

 

Thanks & Regards,

Rohan

4 Replies

Hello @rohanw24,

Can you used the created date to filter out newly created projects / tasks / assignments?

Paul

Hi @Paul Mather,

While filtering projects I'm using this API uri:

https://example.sharepoint.com/sites/pwa/_api/ProjectServer/Projects?$filter=lastSavedDate  gt $DateCriteria&isCheckedOut=true


$DateCriteria will contain timestamp when the application was successfully executed. So that it will consider only those projects that were saved after provided $DateCriteria and which are checked out. Could you please let me know your thoughts on this logic?

Thanks & Regards,
Rohan

Hi @rohanw24 ,

I think you will still get newly created data but the best way to see if the logic is correct is to test every single scenario in Project Online and executing your application.

Paul

Hi @Paul Mather ,

I've changed my filter criteria to:

https://example.sharepoint.com/sites/pwa/_api/ProjectServer/Projects?$filter=CreatedDate lt datetime'$dateCriteria'&LastPublishedDate gt datetime'$dateCriteria'