none
REST API Query Option RRS feed

  • Question

  • Hi,

    While i use the following query it does not return proper result.

    • https://<Server name>/sites/Projects/_api/ProjectData/Tasks?filter=TaskIsMilestone eq 'true' 
    • https://<Server name>/sites/Projects/_api/ProjectData/Assignments?filter=ResourceId eq guid'" + ResourceUID + "'

    Can someone point out how to write the same as i am following this link for the same without luck. 

    https://msdn.microsoft.com/en-us/library/gg309461.aspx#BKMK_filter


    Thanks, Parth


    • Edited by Parth Rawal Saturday, July 11, 2015 4:46 PM
    Saturday, July 11, 2015 4:45 PM

Answers

    • https://<Server name>/sites/Projects/_api/ProjectData/Tasks?filter=TaskIsMilestone eq 'true' 
    • https://<Server name>/sites/Projects/_api/ProjectData/Assignments?filter=ResourceId eq guid'" + ResourceUID + "'

    Looking at your queries again - you have missed the '$' sign from $filter

    These queries work fine:

    /_api/ProjectData/Tasks?$filter=TaskIsMilestone eq true

    /_api/ProjectData/Assignments?$filter=ResourceId eq guid'" + ResourceUID + "'

    Cheers,

       J.


    James Boman BSc. MCP:EAD -

    • Marked as answer by Parth Rawal Tuesday, July 14, 2015 7:36 AM
    Tuesday, July 14, 2015 6:49 AM

All replies

  • Parth,

        If you are executing the queries against an on-prem server that is not patched up to the latest, this may be the reason you are not getting the expected results.  The on-prem ODATA boolean bug was only fixed just recently in the April 2015 CU.

    Cheers,

       James


    James Boman BSc. MCP:EAD -

    Monday, July 13, 2015 11:56 PM
  • Thanks for the reply.

    I have Project Online and it is still not working, can you please run at your end and confirm ?


    Thanks, Parth

    Tuesday, July 14, 2015 6:34 AM
    • https://<Server name>/sites/Projects/_api/ProjectData/Tasks?filter=TaskIsMilestone eq 'true' 
    • https://<Server name>/sites/Projects/_api/ProjectData/Assignments?filter=ResourceId eq guid'" + ResourceUID + "'

    Looking at your queries again - you have missed the '$' sign from $filter

    These queries work fine:

    /_api/ProjectData/Tasks?$filter=TaskIsMilestone eq true

    /_api/ProjectData/Assignments?$filter=ResourceId eq guid'" + ResourceUID + "'

    Cheers,

       J.


    James Boman BSc. MCP:EAD -

    • Marked as answer by Parth Rawal Tuesday, July 14, 2015 7:36 AM
    Tuesday, July 14, 2015 6:49 AM