Rally Software

  • 1.  Agile Central API Project Querying Issue (C#)

    Posted Jun 16, 2017 02:19 PM

    Hello,

     

    I have written an application that interacts with the Agile Central API. I am seeing a weird behaviour whose cause I am unable to determine. I have the following piece of code:

     

    Request request = new Request("Project");
    request.Workspace = "/workspace/" + _workspace;
    request.Query = new Query("(Name = \"" + ProjectName + "\")");
    QueryResult result = _rallyRestApi.Query(request);

     

    I iterate through this code passing in various project names, the workspace stays the same. I am a member of two large projects which both contain children projects under them. We can call those Project A and Project B. When I run this code I can successfully find Project A and it's children when passing in their names, however as soon as I attempt to find Project B I do not have a result returned. I am able to use the website API page and build the query manually and I get the expected result back however when this small piece of code runs I cannot find Project B. I believe I am entering the name correctly as I've looked at it multiple times now.

     

    Any help would be greatly appreciated.



  • 2.  Re: Agile Central API Project Querying Issue (C#)

    Posted Jun 16, 2017 02:48 PM

    Hi Pawel,

     

    Are there any non-alphanumeric characters in the name of Project B? Can you try using the Contains operator and see if that returns Project B?

     

    Thanks,

    Sean Davis



  • 3.  Re: Agile Central API Project Querying Issue (C#)

    Posted Jun 16, 2017 02:55 PM

    Hi Sean,

     

    No, there is only a space in the name, however Project A also contains a space and it is retrieved correctly.

     

    Pawel



  • 4.  Re: Agile Central API Project Querying Issue (C#)

    Posted Jun 16, 2017 03:02 PM

    I have tried using contains but the query does not return any results, even though when I try the query manually using a browser I successfully get results back.



  • 5.  Re: Agile Central API Project Querying Issue (C#)

    Posted Jun 16, 2017 03:18 PM

    Hi Pawel,

     

    I have a couple more suggestions:
    1. Can you try using this constructor instead of the Query(String) constructor?
       Query Constructor (String, Query.Operator, String) 
    2. Can you try running the query by the ObjectID of Project B instead of the Name?

         Query query = new Query("ObjectID", Query.Operator.Equals, "9999999999999");

     

    Thanks,

    Sean Davis



  • 6.  Re: Agile Central API Project Querying Issue (C#)

    Posted Jun 16, 2017 03:30 PM

    Hey Sean,

     

    I've done that, took the Object ID from the Project and modified the query, again no result.

     

    Pawel



  • 7.  Re: Agile Central API Project Querying Issue (C#)

    Posted Jun 16, 2017 03:43 PM

    Other things I can think of:

    1. Triple check both projects are in the same workspace.

    2. Make sure Project B is not closed?

    3. Login to the application using the exact User used in the c# code and make sure that user can see both projects.

     

    If all of the above checks out, I would recommend logging a support ticket. 

     

    Thanks,

    Sean