Пример #1
0
        public List <Issue> GetIssuesResolvedSinceDate(DateTime dateTime)
        {
            var jira = new Jira(_jiraSettings.Url, _jiraSettings.UserName, _jiraSettings.Passsword);

            IssueStatus status     = jira.GetIssueStatuses().FirstOrDefault(x => x.Name == "Resolved");
            var         jiraIssues = from i in jira.Issues
                                     where i.Status == status && i.Project == _jiraSettings.ProjectName
                                     orderby i.Created
                                     select i;

            var issues = new List <Issue>();

            foreach (var jiraIssue in jiraIssues.ToList())
            {
                issues.Add(new Issue()
                {
                    DateResolved = jiraIssue.Updated.Value,
                    Description  = jiraIssue.Description,
                    IssueNumber  = jiraIssue.Key.Value,
                    Reporter     = jiraIssue.Reporter
                });
            }

            return(issues);
        }
Пример #2
0
 public Bug(Guid id, Guid projectId, string title, string description, IssueStatus status, Guid reporterId, Guid?assigneeId, DateTime createdAt, DateTime updatedAt,
            ICollection <Label.Label> labels, ICollection <Comment.Comment> comments) :
     base(id, projectId, title, description, status, reporterId, assigneeId, createdAt, updatedAt)
 {
     Labels   = labels;
     Comments = comments;
 }
Пример #3
0
 internal Issue(string key,
                int projectId,
                DateTime createdOn,
                DateTime?inProgressOn,
                DateTime?codeReviewOn,
                DateTime?readyForDeployOn,
                DateTime?resolvedOn,
                int createdByUserId,
                int?assignedToUserId,
                int?reviewedByUserId,
                IssueStatus status,
                decimal storyPoints)
 {
     this.IssueKey         = key;
     this.ProjectId        = projectId;
     this.CreatedOn        = createdOn;
     this.InProgressOn     = inProgressOn;
     this.CodeReviewOn     = codeReviewOn;
     this.ReadyForDeployOn = readyForDeployOn;
     this.ResolvedOn       = resolvedOn;
     this.CreatedByUserId  = createdByUserId;
     this.AssignedToUserId = assignedToUserId;
     this.ReviewedByUserId = reviewedByUserId;
     this.Status           = status;
     this.StoryPoints      = storyPoints;
 }
Пример #4
0
 public void ChangeStatus(IssueStatus status)
 {
     if (!IsReadonly())
     {
         Status = status;
     }
 }
Пример #5
0
 private static void ValidateStatusEnum(IssueStatus status)
 {
     if (!Enum.IsDefined(typeof(IssueStatus), status))
     {
         throw new InvalidIssueStatusException();
     }
 }
Пример #6
0
        public Issue Update(int issueId, string name, string description, float?estimateHours,
                            IssueType type, IssueStatus status, User assignee, int?parent)
        {
            var issue = Get(issueId);

            Validate.NotNullOrBlank(name);
            if (issue.Parent != null)
            {
                var parentIssue = Get(issue.Parent.Id);
                parentIssue.Children.Remove(issue);
            }
            if (parent != null)
            {
                var parentIssue = Get((int)parent);
                issue.Parent = parentIssue;
                parentIssue.Children.Add(issue);
            }

            issue.Name          = name;
            issue.Description   = description;
            issue.EstimateHours = estimateHours;
            issue.Type          = type;
            issue.Status        = status;
            issue.Assignee      = assignee;

            _databaseContext.Update(issue);
            _databaseContext.SaveChanges();
            return(issue);
        }
        public async Task <IActionResult> Edit(int id, [Bind("Id,Status")] IssueStatus issueStatus)
        {
            if (id != issueStatus.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(issueStatus);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!IssueStatusExists(issueStatus.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(issueStatus));
        }
Пример #8
0
        public void ChangeStatus(Guid issueId, IssueStatus status)
        {
            var issue = _issueRepository.GetById(issueId);

            issue.ChangeStatus(status);
            _unitOfWork.Save();
        }
Пример #9
0
        public static string ToDto(this IssueStatus status, IEnumerable <IssueState> states)
        {
            string equalState = null;

            switch (status)
            {
            case IssueStatus.New:
                equalState = WorkItemStates.Open;
                break;

            case IssueStatus.Closed:
                equalState = WorkItemStates.Closed;
                break;

            case IssueStatus.Open:
                equalState = WorkItemStates.InProgress;
                break;
            }

            if (equalState == null)
            {
                throw new InvalidEnumArgumentException(nameof(states));
            }

            return(states.First(_ => _.Group.Equals(equalState)).Resource);
        }
        public Issue(string id, IssueType type, IssueStatus status, string title, string description, int storyPoints, string projectId, string epicId, string sprintId, IEnumerable <Guid> assignees, IEnumerable <Guid> linkedIssues, DateTime createdAt)
        {
            if (string.IsNullOrWhiteSpace(id))
            {
                throw new InvalidIdException(id);
            }

            if (string.IsNullOrWhiteSpace(projectId))
            {
                throw new InvalidProjectIdException(projectId);
            }

            if (string.IsNullOrWhiteSpace(title))
            {
                throw new InvalidTitleException(title);
            }

            Id           = id;
            Type         = type;
            Status       = status;
            Title        = title;
            Description  = description;
            StoryPoints  = storyPoints;
            ProjectId    = projectId;
            EpicId       = epicId;
            SprintId     = sprintId;
            Assignees    = assignees ??= Enumerable.Empty <Guid>();;
            LinkedIssues = linkedIssues ??= Enumerable.Empty <Guid>();;
            CreatedAt    = createdAt == DateTime.MinValue ? DateTime.Now : createdAt;
        }
Пример #11
0
        /// <summary>
        /// 数据类型转换。增加业务字段处理
        /// </summary>
        /// <returns></returns>
        private List <IssueStatusExt> GetList()
        {
            IEnumerable <IssueStatus> list  = issueStatusService.GetList("");
            List <IssueStatusExt>     list2 = new List <IssueStatusExt>();

            for (int i = 0; i < list.Count(); i++)
            {
                IssueStatus    issueStatus = list.ElementAt(i);
                IssueStatusExt obj         = new IssueStatusExt();
                obj.id                      = issueStatus.id;
                obj.askForComment           = issueStatus.askForComment;
                obj.askForWorklog           = issueStatus.askForWorklog;
                obj.areax                   = issueStatus.areax;
                obj.color                   = issueStatus.color;
                obj.description             = issueStatus.description;
                obj.behavesAsOpen           = issueStatus.behavesAsOpen;
                obj.behavesAsClosed         = issueStatus.behavesAsClosed;
                obj.orderBy                 = issueStatus.orderBy;
                obj.askForComment_Str       = issueStatus.askForComment ? "yes" : "no";
                obj.askForWorklog_Str       = issueStatus.askForWorklog ? "yes" : "no";
                obj.behavesAsClosed_Str     = issueStatus.behavesAsClosed ? "yes" : "no";
                obj.behavesAsOpen_Str       = issueStatus.behavesAsOpen ? "yes" : "no";
                obj.askForComment_checked   = issueStatus.askForComment ? "checked" : "";
                obj.askForWorklog_checked   = issueStatus.askForWorklog ? "checked" : "";
                obj.behavesAsClosed_checked = issueStatus.behavesAsClosed ? "checked" : "";
                obj.behavesAsOpen_checked   = issueStatus.behavesAsOpen ? "checked" : "";
                list2.Add(obj);
            }

            return(list2);
        }
Пример #12
0
 private bool IsIssueCompleted(IssueStatus argStatus)
 {
     if (_completedStatusList.Any(i => i == argStatus.Name))
     {
         return(true);
     }
     return(false);
 }
        public override async Task PostInsert(Issue entity)
        {
            IssueStatus status = new IssueStatus();

            status.IssueId            = entity.Id;
            status.StatusBeschrijving = Entities.Enums.IssueStatusBeschrijving.Nieuw;

            await _issueStatusWriter.InsertAsync(status);
        }
Пример #14
0
        public async Task Save(IssueStatus issueStatus)
        {
            if (_context.Entry(issueStatus).State == EntityState.Detached)
            {
                await _context.IssueStatuses.AddAsync(issueStatus);
            }

            await _context.SaveChangesAsync();
        }
Пример #15
0
 public Issue(ICar car, string details)
 {
     _nextIssueNr++;
     this.Nr      = _nextIssueNr;
     this.Car     = car;
     this.Details = details;
     this.Status  = IssueStatus.Pending;
     PrintDetails();
 }
Пример #16
0
 public NewIssuePage SelectStatus(IssueStatus status)
 {
     comboboxStatus = new SelectElement(SearchElementUtil.GetElement(driver, locatorComboboxStatus));
     if (status != IssueStatus.Default)
     {
         comboboxStatus.SelectByText(status.ToString().Replace(" ", ""));
     }
     return(this);
 }
Пример #17
0
 public bool EditStatus(IssueStatus newStatus)
 {
     if (!_issueStatusEngine.StatusExists(newStatus.IssueStatusId))
     {
         throw new Exception("Status Doesnot exists ");
     }
     _issueStatusEngine.EditStatus(newStatus);
     return(true);
 }
Пример #18
0
 public IssueListItem(Guid id, Guid projectId, Enums.IssueType issueType, string title, string description, IssueStatus status, Guid reporterId, Guid?assigneeId)
 {
     Id          = id;
     ProjectId   = projectId;
     IssueType   = issueType;
     Title       = title;
     Description = description;
     Status      = status;
     ReporterId  = reporterId;
     AssigneeId  = assigneeId;
 }
Пример #19
0
 /// <summary>
 /// Sets the status to suspended. Does the same to sub issues.
 /// </summary>
 public void SuspendIssue()
 {
     _status = IssueStatus.Suspended;
     if (_subIssues != null)
     {
         foreach (IssueModel item in _subIssues)
         {
             item.SuspendIssue();
         }
     }
 }
Пример #20
0
 public async Task <IEnumerable <Issues> > GetIssues(int take, int skip, IssueStatus status)
 {
     return(await _issues
            .GetAll()
            .Where(x => x.Status == status)
            .Include(x => x.IssueCategory)
            .Include(x => x.UserReported)
            .Skip(skip)
            .Take(take)
            .ToListAsync());
 }
Пример #21
0
        private IssueStatus CreateSampleStatus()
        {
            IssueStatus status = new IssueStatus()
            {
                IssueStatusId = 1,
                StatusName    = "In progress",
                CreatedBy     = "Placida"
            };

            return(status);
        }
        public async Task <IActionResult> Create([Bind("Id,Status")] IssueStatus issueStatus)
        {
            if (ModelState.IsValid)
            {
                _context.Add(issueStatus);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(issueStatus));
        }
Пример #23
0
 //https://github.com/alterm4nn/ChronoZoom/issues/744
 public void random_new_exhibit_should_have_a_year()
 {
     if (IssueStatus.IsIssueResolved("744"))
     {
         Assert.AreEqual(Exhibit.Year, _newExhibit.Year, "Years are not equal");
     }
     else
     {
         Assert.IsTrue(true, "Bug has not been resolved yet");
     }
 }
Пример #24
0
        private static IEnumerable <IssueStatus> GetAvailableStatuses(IssueStatus status)
        {
            var availableStatues = new List <IssueStatus> {
                status
            };

            switch (status)
            {
            case IssueStatus.Open:
                availableStatues.AddRange(new []
                {
                    IssueStatus.InProgress,
                    IssueStatus.Resolved,
                    IssueStatus.Closed
                });
                break;

            case IssueStatus.InProgress:
                availableStatues.AddRange(new[]
                {
                    IssueStatus.Open,
                    IssueStatus.Resolved,
                    IssueStatus.Closed
                });
                break;

            case IssueStatus.Resolved:
                availableStatues.AddRange(new[]
                {
                    IssueStatus.Reopened,
                    IssueStatus.Closed
                });
                break;

            case IssueStatus.Closed:
                availableStatues.AddRange(new[]
                {
                    IssueStatus.Reopened
                });
                break;

            case IssueStatus.Reopened:
                availableStatues.AddRange(new[]
                {
                    IssueStatus.InProgress,
                    IssueStatus.Resolved,
                    IssueStatus.Closed
                });
                break;
            }

            return(availableStatues);
        }
 public UpdateIssue(string issueId, IssueType type, IssueStatus status, string title, string description, int storyPoints, string epicId, IEnumerable <Guid> assignees, IEnumerable <Guid> linkedIssues)
 {
     IssueId      = issueId;
     Type         = type;
     Status       = status;
     Title        = title;
     Description  = description;
     StoryPoints  = storyPoints;
     EpicId       = epicId;
     Assignees    = assignees ?? Enumerable.Empty <Guid>();
     LinkedIssues = linkedIssues ?? Enumerable.Empty <Guid>();
 }
Пример #26
0
        /// <summary>
        /// Creates a new issue.
        /// </summary>
        public Issue(IssueStatus status, IssuePriority priority, string summary, string description, string version, string targetVersion)
        {
            Status        = status;
            Priority      = priority;
            Summary       = summary;
            Description   = description;
            Version       = version;
            TargetVersion = targetVersion;

            DateCreated  = DateTime.Now;
            DateModified = DateTime.Now;
        }
Пример #27
0
 /// <summary>
 /// Sets the starting date (if this is the very first time) and sets the status to "In Progress". Does the same to parent issues.
 /// </summary>
 public void StartIssue()
 {
     if (_startingDate == default(DateTime))
     {
         _startingDate = DateTime.Today;
     }
     _status = IssueStatus.InProgress;
     if (_parentIssue != null)
     {
         _parentIssue.StartIssue();
     }
 }
Пример #28
0
        public string GetStatusImage(IssueStatus status)
        {
            switch (status)
            {
            case IssueStatus.Unresolved: return("statusUnresolved.png");

            case IssueStatus.InProgress: return("statusInProgress.png");

            case IssueStatus.Done: return("statusDone.png");
            }

            return("");
        }
        private static Issue CreateIssueWithExtraInfoNeed(Gebruiker gebruiker, Gebruiker solver, int i = 0)
        {
            Issue issue = CreateInBehandelingIssue(gebruiker, solver, i);

            issue = CreateAndAddIssueStatusToIssue(issue, IssueStatusBeschrijving.ExtraInfo, solver);
            IssueStatus issuestatus = issue.IssueStatussen.Single();
            ExtraInfo   extraInfo   = new ExtraInfo();

            extraInfo.IssueStatus = issuestatus;
            extraInfo.InfoVraag   = "vraag: " + i;
            issuestatus.ExtraInfos.Add(extraInfo);
            return(issue);
        }
Пример #30
0
		public static string AsString(this IssueStatus status)
		{
			switch (status)
			{
				case IssueStatus.New:
				case IssueStatus.Open:
					return "reopen";
				case IssueStatus.Closed:
					return "close";
				default:
					throw new Exception($"Unsupported GitLab issue status. Status='{status}'");
			}
		}
        public override object Deserialize(IDictionary<string, object> dictionary, Type type, JavaScriptSerializer serializer)
        {
            if (dictionary != null)
            {
                var issueStatus = new IssueStatus();

                issueStatus.Id = dictionary.GetValue<int>(RedmineKeys.ID);
                issueStatus.Name = dictionary.GetValue<string>(RedmineKeys.NAME);
                issueStatus.IsClosed = dictionary.GetValue<bool>(RedmineKeys.IS_CLOSED);
                issueStatus.IsDefault = dictionary.GetValue<bool>(RedmineKeys.IS_DEFAULT);
                return issueStatus;
            }

            return null;
        }
        public override object Deserialize(IDictionary<string, object> dictionary, Type type, JavaScriptSerializer serializer)
        {
            if (dictionary != null)
            {
                var issueStatus = new IssueStatus();

                issueStatus.Id = dictionary.GetValue<int>("id");
                issueStatus.Name = dictionary.GetValue<string>("name");
                issueStatus.IsClosed = dictionary.GetValue<bool>("is_closed");
                issueStatus.IsDefault = dictionary.GetValue<bool>("is_default");
                return issueStatus;
            }

            return null;
        }
Пример #33
0
 //public static void DecreaseID()
 //{
 //    nextNumber--;
 //}
 public static List<Issue> SelectIssuesByStatus(IssueStatus status)
 {
     List<Issue> selectedIssues = issues.Where(i => i.CurrentStatus == status).ToList();
     return selectedIssues;
 }
Пример #34
0
 public List<Issue> SelectIssuesByStatus(IssueStatus status)
 {
     return IssueDataAccess.SelectIssuesByStatus(status);
 }
 private int GetIssueStatusToPercentComplete(IssueStatus status) {
     switch (status.Name) {
         case "Done":
             return 100;
         case "Code Review":
             return 75;
         case "In Progress":
             return 25;
         default:
             return 0;
     }
 }
Пример #36
0
        internal Issue(RedmineServiceContext context, XmlNode node)
            : base(context, node)
        {
            _parent			= RedmineUtility.LoadObject(node[ParentProperty.XmlNodeName],				context.Issues.Lookup);

            _project		= RedmineUtility.LoadNamedObject(node[ProjectProperty.XmlNodeName],			context.Projects.Lookup);
            _tracker		= RedmineUtility.LoadNamedObject(node[TrackerProperty.XmlNodeName],			context.Trackers.Lookup);
            _status			= RedmineUtility.LoadNamedObject(node[StatusProperty.XmlNodeName],			context.IssueStatuses.Lookup);
            _priority		= RedmineUtility.LoadNamedObject(node[PriorityProperty.XmlNodeName],		context.IssuePriorities.Lookup);

            _author			= RedmineUtility.LoadNamedObject(node[AuthorProperty.XmlNodeName],			context.Users.Lookup);
            _assignedTo		= RedmineUtility.LoadNamedObject(node[AssignedToProperty.XmlNodeName],		context.Users.Lookup);

            _category		= RedmineUtility.LoadNamedObject(node[CategoryProperty.XmlNodeName],		context.IssueCategories.Lookup);
            _fixedVersion	= RedmineUtility.LoadNamedObject(node[FixedVersionProperty.XmlNodeName],	context.ProjectVersions.Lookup);

            _subject		= RedmineUtility.LoadString(node[SubjectProperty.XmlNodeName]);
            _description	= RedmineUtility.LoadString(node[DescriptionProperty.XmlNodeName]);

            _startDate		= RedmineUtility.LoadDate(node[StartDateProperty.XmlNodeName]);
            _dueDate		= RedmineUtility.LoadDate(node[DueDateProperty.XmlNodeName]);

            _doneRatio		= RedmineUtility.LoadDouble(node[DoneRatioProperty.XmlNodeName]);
            _estimatedHours	= RedmineUtility.LoadDouble(node[EstimatedHoursProperty.XmlNodeName]);

            _customFields	= RedmineUtility.LoadCustomFields(node[CustomFieldsProperty.XmlNodeName],	context.CustomFields.Lookup);

            _createdOn		= RedmineUtility.LoadDateForSure(node[CreatedOnProperty.XmlNodeName]);
            _updatedOn		= RedmineUtility.LoadDateForSure(node[UpdatedOnProperty.XmlNodeName]);
        }
Пример #37
0
        public void UpdateStatus(IssueStatus newStatus, DateTime occurredOn, string comments = "")
        {
            if (occurredOn < EntryDate)
                throw new ArgumentException();

            IssueTransition transition = new IssueTransition(newStatus, occurredOn, comments);
            Transitions.Add(transition.OccurredOn, transition);
        }
Пример #38
0
 /// <summary>
 /// Initializes a new instance of the <see cref="StatusViewModel" /> class.
 /// </summary>
 /// <param name="parent">The parent.</param>
 /// <param name="status">The status.</param>
 /// <param name="isChecked">if set to <c>true</c> [is checked].</param>
 public StatusViewModel(object parent, IssueStatus status, bool isChecked)
     : base(parent)
 {
     IssueStatus = status;
     IsChecked = isChecked;
 }