Search code examples
apirallycode-rally

why contains keyword is not working on rally api query


I am trying to query on rally api by using below

req.Query = new Query("User.ObjectID", Query.Operator.Equals, loggedinUser.ToString()).And(new Query("Role", Query.Operator.Contains, Role).And(new Query("Workspace.ObjectID", Query.Operator.Contains, workspaceID)).And(new Query("Project.ObjectID", Query.Operator.Equals, projectObjectID)));

But it is throwing error as

The operator [ contains ] is not supported for this attribute type. The available operators are [ =, !=, >, <, >=, <=, in ]

is it contains key word is deprecated? please help me alternative in such case.


Solution

  • As per https://communities.ca.com/thread/241816885-why-contains-keyword-is-not-working-on-rally-api-query?et=watches.email.outcome

    contains no longer supports in such type of queries but previously it is worked.

    Its working when I replaced 'Contains' with 'Equals' as

     req.Query = new Query("User.ObjectID", Query.Operator.Equals, loggedinUser.ToString()).And(new Query("Role", Query.Operator.Equals, Role).And(new Query("Workspace.ObjectID", Query.Operator.Equals, workspaceID)).And(new Query("Project.ObjectID", Query.Operator.Equals, projectObjectID)));