Exemple #1
0
        /// <summary>
        /// Gets the stories for a project using a filter to limit the data returned
        /// </summary>
        /// <see cref="PivotalTrackerAPI.Util.PivotalFilterHelper"/>
        /// <remarks>See http://www.pivotaltracker.com/help/api?version=v3#get_iterations_with_limit_and_offset</remarks>
        /// <param name="user">The user to get the ApiToken from</param>
        /// <param name="projectId">The id of the project to get stories for</param>
        /// <param name="iterationGroup">The group of iterations to constrain the list to (use unknown or all to disregard this option)</param>
        /// <param name="limit">The maximum number of iterations to return</param>
        /// <param name="offset">The number of iterations to skip from the beginning of the result.</param>
        /// <returns>the stories grouped by iteration for the project</returns>
        public static IList <PivotalIteration> FetchIterations(PivotalUser user, int projectId, PivotalIterationGroup iterationGroup, Nullable <int> limit, Nullable <int> offset)
        {
            string groupSelector = "";

            if (iterationGroup != PivotalIterationGroup.unknown && iterationGroup != PivotalIterationGroup.all)
            {
                groupSelector = "/" + iterationGroup.ToString();
            }
            string url = String.Format("{0}/projects/{1}/iterations{2}?token={3}", PivotalService.BaseUrl, projectId.ToString(), groupSelector, user.ApiToken);

            if (limit.HasValue)
            {
                url += "&limit=" + limit.ToString();
            }
            if (offset.HasValue)
            {
                url += "&offset=" + offset.ToString();
            }
            XmlDocument          xmlDoc        = PivotalService.GetData(url);
            PivotalIterationList iterationList = SerializationHelper.DeserializeFromXmlDocument <PivotalIterationList>(xmlDoc);

            return(iterationList.Iterations);
        }
 /// <summary>
 /// Gets the stories for a project using a filter to limit the data returned
 /// </summary>
 /// <see cref="PivotalTrackerAPI.Util.PivotalFilterHelper"/>
 /// <remarks>See http://www.pivotaltracker.com/help/api?version=v3#get_iterations_with_limit_and_offset</remarks>
 /// <param name="user">The user to get the ApiToken from</param>
 /// <param name="projectId">The id of the project to get stories for</param>
 /// <param name="iterationGroup">The group of iterations to constrain the list to (use unknown or all to disregard this option)</param>
 /// <param name="limit">The maximum number of iterations to return</param>
 /// <param name="offset">The number of iterations to skip from the beginning of the result.</param>
 /// <returns>the stories grouped by iteration for the project</returns>
 public static IList<PivotalIteration> FetchIterations(PivotalUser user, int projectId, PivotalIterationGroup iterationGroup, Nullable<int> limit, Nullable<int> offset)
 {
   string groupSelector = "";
   if (iterationGroup != PivotalIterationGroup.unknown && iterationGroup != PivotalIterationGroup.all)
     groupSelector = "/" + iterationGroup.ToString();
   string url = String.Format("{0}/projects/{1}/iterations{2}?token={3}", PivotalService.BaseUrl, projectId.ToString(), groupSelector, user.ApiToken);
   if (limit.HasValue)
     url += "&limit=" + limit.ToString();
   if (offset.HasValue)
     url += "&offset=" + offset.ToString();
   XmlDocument xmlDoc = PivotalService.GetData(url);
   PivotalIterationList iterationList = SerializationHelper.DeserializeFromXmlDocument<PivotalIterationList>(xmlDoc);
   return iterationList.Iterations;
 }
Exemple #3
0
 /// <summary>
 /// Gets the stories for a project using a filter to limit the data returned
 /// </summary>
 /// <see cref="PivotalTrackerAPI.Util.PivotalFilterHelper"/>
 /// <remarks>See http://www.pivotaltracker.com/help/api?version=v3#get_iterations_with_limit_and_offset</remarks>
 /// <param name="user">The user to get the ApiToken from</param>
 /// <param name="projectId">The id of the project to get stories for</param>
 /// <param name="iterationGroup">The group of iterations to constrain the list to (use unknown or all to disregard this option)</param>
 /// <returns>the stories grouped by iteration for the project</returns>
 public static IList <PivotalIteration> FetchIterations(PivotalUser user, int projectId, PivotalIterationGroup iterationGroup)
 {
     return(FetchIterations(user, projectId, iterationGroup, null, null));
 }
 /// <summary>
 /// Gets the stories for a project using a filter to limit the data returned
 /// </summary>
 /// <see cref="PivotalTrackerAPI.Util.PivotalFilterHelper"/>
 /// <remarks>See http://www.pivotaltracker.com/help/api?version=v3#get_iterations_with_limit_and_offset</remarks>
 /// <param name="user">The user to get the ApiToken from</param>
 /// <param name="projectId">The id of the project to get stories for</param>
 /// <param name="iterationGroup">The group of iterations to constrain the list to (use unknown or all to disregard this option)</param>
 /// <returns>the stories grouped by iteration for the project</returns>
 public static IList<PivotalIteration> FetchIterations(PivotalUser user, int projectId, PivotalIterationGroup iterationGroup)
 {
   return FetchIterations(user, projectId, iterationGroup, null, null);
 }