Post

1 follower Follow
0
Avatar

Missing Projects from MyWorkItemQuery

When doing a MyWorkItemQuery I am no longer returning any new projects that have been recently setup.  I can still see all of the existing projects but any setup in the last few weeks are missing.

I can find nothing in the projects themselves that looks different.

 

Any suggestions?

 

            Dim queryMyWorkItems As New ClarizenService.MyWorkItemsQuery

            queryMyWorkItems.ItemsType = CType(WorkItemType, ClarizenService.WorkItemType)

            queryMyWorkItems.ItemsTypeSpecified = True

            queryMyWorkItems.ItemsFilter = CType(WorkItemFilter, ClarizenService.WorkItemFilter)

            queryMyWorkItems.ItemsFilterSpecified = True

            queryMyWorkItems.ItemsState = CType(WorkItemState, ClarizenService.WorkItemState)

            queryMyWorkItems.ItemsStateSpecified = True

            queryMyWorkItems.Permissions = ClarizenService.PermissionOptions.ObjectAndFields

            queryMyWorkItems.PermissionsSpecified = True

            queryMyWorkItems.Fields = {"Project", "Name", "SYSID"}

            queryMyWorkItems.Orders = New ClarizenService.OrderBy() {New ClarizenService.OrderBy With {.FieldName = "Project"},

                                                                     New ClarizenService.OrderBy With {.FieldName = "SYSID"}

                                                                    }

            queryMyWorkItems.Paging = New ClarizenService.Paging With {.PageSize = 300}

 

            Try

                GlobalStuff.queryResult = cClient.Query(queryMyWorkItems)

                If GlobalStuff.queryResult.Entities.Count > 0 Then

                    For Each ge As ClarizenService.GenericEntity In GlobalStuff.queryResult.Entities

                        Dim geProject As ClarizenService.GenericEntity = CType(ge.Values(0).Value, ClarizenService.GenericEntity)

                        If IsNothing(geProject) Then

                            'xDic.Add(Nothing, "Error")

                        Else

                            xDic.Add(ge, geProject.Id.Value & CStr(ge.Values(2).Value) & " - " & CStr(ge.Values(1).Value))

                        End If

                    Next ge

                End If

                If GlobalStuff.queryResult.Paging.HasMore Then

                    Do While GlobalStuff.queryResult.Paging.HasMore

                        queryMyWorkItems.Paging = queryResult.Paging

                        GlobalStuff.queryResult = cClient.Query(queryMyWorkItems)

                        For Each ge As ClarizenService.GenericEntity In GlobalStuff.queryResult.Entities

                            Dim geProject As ClarizenService.GenericEntity = CType(ge.Values(0).Value, ClarizenService.GenericEntity)

                            xDic.Add(ge, geProject.Id.Value & CStr(ge.Values(2).Value) & " - " & CStr(ge.Values(1).Value))

                        Next ge

                    Loop

.........

Mark Alford Answered

Please sign in to leave a comment.

4 comments

0
Avatar

Hi Mark,

I tried your code on my account and it worked fine, except I had to change queryResult.Paging -> GlobalStuff.queryResult.Paging.

I do not know of any breaking changes in Clarizen that could cause issues with your query.

Is it possible you've missed something with the paging object? Are you getting exactly 300 results? 

Hope this helps,

Ophir

Ophir Kenig 0 votes
Comment actions Permalink
0
Avatar

The paging works fine.  In reading the 2.0 api it looks as though generic entities have been depreciated. Could this be an impediment?

 

Mark Alford 0 votes
Comment actions Permalink
0
Avatar

Hi Mark,

API 2.0 calls it Entity _and deprecates _BaseEntity. However, if you're still using API V1.0 this is not causing the issue.

If it's fine with you, please send me some details to ophir.kenig@clarizen.com and I'll have a look with your account.

  1. The credentials you were using 
  2. The value of the filters
  3. Some project Id (P-xxxxxx) that was supposed to be retrieved and wasn't.

Hope this helps,

Ophir

Ophir Kenig 0 votes
Comment actions Permalink
0
Avatar

Hi Mark,

For the benefit of developers:

Let me stress that entity id values are not necessarily GUIDs. The value can be any string as long as it's unique for that entity within your organization. When an entity is created via the API you can assign any (unique) string value to the entity id. Only If you leave it blank Clarizen will assign a GUID value to it, but you cannot rely on entity id value being a GUID.

Hope this helps,

Ophir

Ophir Kenig 0 votes
Comment actions Permalink