code: func (c *WorkItemTypeGroupsController) List(ctx *app.ListWorkItemTypeGroupsContext) error {
  	var typeGroups []*workitem.WorkItemTypeGroup
  	err := application.Transactional(c.db, func(appl application.Application) error {
  		list, err := appl.WorkItemTypeGroups().List(ctx, ctx.SpaceTemplateID)
  		if err != nil {
  			return errs.WithStack(err)
  		}
  		typeGroups = list
  		return nil
  	})
  	if err != nil {
  		return jsonapi.JSONErrorResponse(ctx, err)
  	}
  	res := &app.WorkItemTypeGroupList{
  		Data: make([]*app.WorkItemTypeGroupData, len(typeGroups)),
  		Links: &app.WorkItemTypeGroupLinks{
  			Self: rest.AbsoluteURL(ctx.Request, app.SpaceTemplateHref(ctx.SpaceTemplateID)) + "/" + APIWorkItemTypeGroups,
  		},
  	}
  	for i, group := range typeGroups {
  		res.Data[i] = ConvertTypeGroup(ctx.Request, *group)
  	}
  	return ctx.OK(res)
  }
docs: // List runs the list action.