private Milestone GetOrCreateMilestone(string sprintName, int projectId)
 {
     var mileStone = new Milestone
     {
         Name = sprintName,
         ProjectId = projectId
     };
     var mileStoneExists = _testrail.Extension.GetMilestoneByName(sprintName, projectId);
     if (mileStoneExists != null) return mileStoneExists;
     mileStone = _testrail.AddMilestone(projectId, mileStone);
     return mileStone;
 }
 private TestPlan CreateTestPlanForIssue(Issue issue, Milestone milestone)
 {
     var planName = $"[DEV] {issue.Key}: {issue.Summary}";
     var planAcceptanceCriteria = _jira.GetCustomFieldFromIssue(issue, "Acceptance Criteria");
     var planDescription =
         $"Description:\r\n{issue.Description}\r\n\r\nAcceptance Criteria:\r\n{planAcceptanceCriteria}";
     var plan = new TestPlan
     {
         MilestoneId = milestone.Id,
         Name = planName,
         Description = planDescription,
         ProjectId = milestone.ProjectId
     };
     return plan;
 }
示例#3
0
 public Milestone AddMilestone(int projectId, Milestone milestone)
 {
     var url = $"add_milestone/{projectId}";
     var response = _client.SendPost(url, milestone);
     return JsonConvert.DeserializeObject<Milestone>(response.ToString());
 }
示例#4
0
 public Milestone UpdateMilestone(int milestoneId, Milestone milestone)
 {
     var url = string.Format("update_milestone/" + milestoneId);
     var originalMilestone = GetMilestone(milestoneId);
     originalMilestone.MergeWith(milestone);
     var response = _client.SendPost(url, originalMilestone);
     return JsonConvert.DeserializeObject<Milestone>(response.ToString());
 }