code: func (c *SpaceIterationsController) List(ctx *app.ListSpaceIterationsContext) error {
  	err := application.Transactional(c.db, func(appl application.Application) error {
  		err := appl.Spaces().CheckExists(ctx, ctx.SpaceID)
  		if err != nil {
  			return err
  		}
  		iterations, err := appl.Iterations().List(ctx, ctx.SpaceID)
  		if err != nil {
  			return err
  		}
  		return ctx.ConditionalEntities(iterations, c.config.GetCacheControlIterations, func() error {
  			itrMap := make(iterationIDMap)
  			for _, itr := range iterations {
  				itrMap[itr.ID] = itr
  			}
  			// fetch extra information(counts of WI in each iteration of the space) to be added in response
  			wiCounts, err := appl.WorkItems().GetCountsPerIteration(ctx, ctx.SpaceID)
  			log.Debug(ctx, map[string]interface{}{
  				"space_id": ctx.SpaceID.String(),
  			}, "Retrieving wicounts for spaceID %s -> %v", ctx.SpaceID.String(), wiCounts)
  
  			if err != nil {
  				return err
  			}
  			res := &app.IterationList{}
  			res.Data = ConvertIterations(ctx.Request, iterations, updateIterationsWithCounts(wiCounts), parentPathResolver(itrMap))
  			return ctx.OK(res)
  		})
  	})
  	if err != nil {
  		return jsonapi.JSONErrorResponse(ctx, err)
  	}
  	return nil
  }
docs: // List runs the list action.