I am running into a problem with the VersionOneAPIClient in that it will not recognize anything I give it ass an asset type. I understand the Attribute definitions probably don't make any sense but I've been trying pretty much everything. My end goal would be to query TeamRooms and get team names from all the teams in the team room.
It's my understanding from the documentation on asset types and how to query that this should work but that's what we all say.
I am using: C# ASP.NET, VersionOneAPIClient 15.0.0.0
Strings I have tried:
- TeamRoom
- Task
- Scope
Project
public bool APIgetTeams() { IAssetType teamroomType = services.Meta.GetAssetType("Task"); Query query = new Query(teamroomType); IAttributeDefinition teamAttribute = teamroomType.GetAttributeDefinition("Children:Room.Team.Name"); query.Selection.Add(teamAttribute); IAttributeDefinition scheduleAttribute = teamroomType.GetAttributeDefinition("Children:Scope.Room.Schedule.Name"); query.Selection.Add(scheduleAttribute); query.Find = new QueryFind(scheduleName, new AttributeSelection(scheduleAttribute)); query.Paging.PageSize = 1; query.Paging.PageSize = 0; teamRoomAsset = (Asset)services.Retrieve(query).Assets.ToArray().GetValue(0); return true; }
My definition of services and the connector:
public static V1Connector connector = V1Connector
.WithInstanceUrl("http://versionone.cscinfo.com/VersionOneProd/")
.WithUserAgentHeader("New Dashboard?", "1.0")
.WithWindowsIntegrated()
.Build();
public IServices services = new Services(connector);
And these are my Errors / Stack Traces:
The error is likely simple and right in my face but I can't figure it out.