Beispiel #1
0
        /// <summary>
        /// Creates a new story in a project.
        /// </summary>
        /// <param name="projectId">Id of the project to create a story in.</param>
        /// <param name="pivotalStory">Pre-created story to create in the project.</param>
        /// <returns>Returns a completed PivotalStory.</returns>
        public PivotalStory CreateNewStory(int projectId, PivotalNewStory pivotalStory)
        {
            // Try and create a new PivotalStory
            var response = HttpService.PostAsync(StringUtil.PivotalStoriesUrl(projectId), pivotalStory).Result;

            return(HandleResponse <PivotalStory>(response));
        }
Beispiel #2
0
        /// <summary>
        /// Creates a new story in a project.
        /// </summary>
        /// <param name="projectId">Id of the project to create a story in.</param>
        /// <param name="name">The name you wish to give to the story.</param>
        /// <param name="storyType">Type of the story, eg feature, bug.</param>
        /// <param name="labels">Any labels you wish to give to the story.</param>
        /// <param name="description">(optional) Description of the story. Use this for additional info.</param>
        /// <returns>Returns a completed PivotalStory</returns>
        public PivotalStory CreateNewStory(int projectId, string name, StoryType storyType, List <string> labels = null, string description = null)
        {
            var story = new PivotalNewStory
            {
                Name        = name,
                Description = description,
                Labels      = labels ?? new List <string>(),
                StoryType   = storyType.ToString()
            };
            var response = HttpService.PostAsync(StringUtil.PivotalStoriesUrl(projectId), story).Result;

            return(HandleResponse <PivotalStory>(response));
        }
Beispiel #3
0
        public void TestCreateProjectStory()
        {
            var story = new PivotalNewStory
            {
                Name        = "My new story",
                Description = "My new description",
                StoryType   = StoryType.bug.ToString(),
                Labels      = new List <string>
                {
                    "My label"
                }
            };
            var createdStory = pt.CreateNewStory(_testProjectId, story);

            Assert.IsNotNull(createdStory);
        }