/// <summary> /// Returns the first matter artifact ID that matches the name provided. /// </summary> /// <param name="name"></param> /// <returns></returns> public int QueryMatterIDByName(string name) { int matterID; MatterQueryResultSet results; var query = new Services.Query { Condition = $"('Name' == '{name}')" }; using (var matterManager = _helper.GetServicesManager().CreateProxy <IMatterManager>(ExecutionIdentity.CurrentUser)) { results = matterManager.QueryAsync(query).Result; } if (results.Success) { matterID = results.Results[0].Artifact.ArtifactID; } else { throw new IntegrationTestException($"Failed to retrieve matter by name equal to {name}"); } return(matterID); }
/// <summary> /// Returns the first client ID which matches the name supplied. /// </summary> /// <param name="name"></param> /// <returns></returns> public int QueryClientIDByName(string name) { int clientID; ClientQueryResultSet results; var query = new Services.Query { Condition = $"('Name' == '{name}')" }; using (IClientManager proxy = _helper.GetServicesManager().CreateProxy <IClientManager>(API.ExecutionIdentity.System)) { results = proxy.QueryAsync(query).Result; } if (results.Success) { clientID = results.Results[0].Artifact.ArtifactID; } else { throw new Exceptions.IntegrationTestException($"Client was not found with name equal to {name}"); } return(clientID); }