code: func (a WorkItemInterfaceSlice) Less(i, j int) bool {
  	var x, y *app.WorkItem
  
  	switch v := a[i].(type) {
  	case app.WorkItem:
  		x = &v
  	case *app.WorkItem:
  		x = v
  	}
  
  	switch v := a[j].(type) {
  	case app.WorkItem:
  		y = &v
  	case *app.WorkItem:
  		y = v
  	}
  
  	if x == nil || y == nil {
  		return false
  	}
  
  	title1, foundTitle1 := x.Attributes[workitem.SystemTitle]
  	title2, foundTitle2 := y.Attributes[workitem.SystemTitle]
  	if foundTitle1 && foundTitle2 {
  		t1, cast1Ok := title1.(string)
  		t2, cast2Ok := title2.(string)
  		if cast1Ok && cast2Ok {
  			return t1 < t2
  		}
  	}
  	return x.ID.String() < y.ID.String()
  }
docs: // Less reports whether the element with index i should sort before the element
  // with index j.
  //
  // NOTE: For now we assume that included elements in the search response are
  // only work items. We can handle work items as pointers or objects. Both
  // options are possible.