public void TesRestOfProperties()
        {
            var issue = new Issue();
            var connector = new SonarRestService(new JsonSonarConnector());
            var projectAsso = new Resource { Key = "proj" };
            var model = new ExtensionDataModel(this.service, this.vshelper, null, null)
            {
                AssociatedProjectKey = "proj",
                CommentData = "comment",
                SelectedIssue = issue,
                SonarInfo = "ver",
                SelectedUser = new User { Login = "******" },
                DiagnosticMessage = "MessageData",
                DisableEditorTags = false,
                RestService = connector,
                AssociatedProject = projectAsso,
            };

            Assert.AreEqual("Selected Project: proj", model.AssociatedProjectKey);
            Assert.AreEqual(issue, model.SelectedIssue);
            Assert.AreEqual("comment", model.CommentData);
            Assert.AreEqual("login", model.SelectedUser.Login);
            Assert.AreEqual("ver", model.SonarInfo);
            Assert.AreEqual("MessageData", model.DiagnosticMessage);
            Assert.IsFalse(model.DisableEditorTags);
            Assert.AreEqual(connector, model.RestService);
            Assert.AreEqual(projectAsso, model.AssociatedProject);
        }
Esempio n. 2
0
        public static IEnumerable<Issue> Parse(string full)
        {
            if (string.IsNullOrEmpty(full))
                return Enumerable.Empty<Issue>();

            LinkedList<Issue> list = new LinkedList<Issue>();

            JsonData data = JsonMapper.ToObject(full);
            for (int i = 0; i < data.Count; i++)
            {
                Issue issue = new Issue();
                issue.Id = (int)data[i]["number"];
                issue.Summary = (string)data[i]["title"];
                issue.Status = (string)data[i]["state"];
                if (data[i]["assignee"] != null)
                {
                    issue.Owner = (string)data[i]["assignee"]["login"];
                }
                if (data[i]["milestone"] != null)
                {
                    issue.Milestone = (string)data[i]["milestone"]["title"];
                }
                issue.Status = (string)data[i]["state"];
                list.AddLast(issue);
            }
            return list;
        }
Esempio n. 3
0
        public static void LogMessage(string message, Issue.IssueLevel issueLevel)
        {
            try
            {
                ShowMessage(string.Format("{0}: {1}", issueLevel, message), ConsoleColor.Blue);

                switch(issueLevel)
                {
                    case Issue.IssueLevel.Error:
                        ShowMessage(message, ConsoleColor.Red);
                        Trace.TraceError(message);
                        RegisterMessageAsync(message, issueLevel);
                        break;
                    case Issue.IssueLevel.Warning:
                        ShowMessage(message, ConsoleColor.Yellow);
                        Trace.TraceWarning(message);
                        RegisterMessageAsync(message, issueLevel);
                        break;
                    case Issue.IssueLevel.Information:
                        ShowMessage(message, ConsoleColor.Green);
                        Trace.TraceInformation(message);
                        //RegisterMessageAsync(message, issueLevel); //This will be too much and of no value to the support service.
                        break;
                    default:
                        throw new ArgumentOutOfRangeException(string.Format("Unknown issuelevel {0}.", issueLevel));
                }
            }
            catch (Exception exp)
            {
                ShowMessage(exp.Message, ConsoleColor.DarkMagenta);
            }
        }
        public void BuildMessage_IssueCreatedThenUpdated_ExpectOneCreationMessage()
        {
            //Arrange
            var jiraMessageBuilder = new JiraMessageBuilder("http://jira");

            var user = new User {displayName = "Laurent Kempé", name = "laurent"};

            var sameIssue = new Issue {key = "LK-10", fields = new Fields {summary = "Issue Description", reporter = user, assignee = user}};

            var jiraModel1 = new JiraModel
            {
                webhookEvent = "jira:issue_created",
                issue = sameIssue
            };

            var jiraModel2 = new JiraModel
            {
                webhookEvent = "jira:issue_updated",
                issue = sameIssue
            };

            var sameJiraIssueKeyEvents = new List<JiraModel> { jiraModel1, jiraModel2 };

            //Act
            var buildMessage = jiraMessageBuilder.BuildMessage(sameJiraIssueKeyEvents);

            //Assert
            Assert.That(buildMessage, Is.EqualTo("<b><a href='http://jira/browse/LK-10'>LK-10 Issue Description</a></b> has been created by <a href='http://jira/secure/ViewProfile.jspa?name=laurent'>Laurent Kempé</a> and current assignee is <a href='http://jira/secure/ViewProfile.jspa?name=laurent'>Laurent Kempé</a>."));
        }
        partial void Issues_Validate(Issue entity, EntitySetValidationResultsBuilder results)
        {
            if (entity.TargetResolutionDate != null & entity.DateRaised != null)
            {
                if (entity.TargetResolutionDate < entity.DateRaised)
                {
                    results.AddEntityError("The target date cannot be earlier than the date raised");
                }
            }

            if (entity.TargetResolutionDate != null & entity.CorrectiveActionCompletionTargetDate != null)
            {
                if (entity.TargetResolutionDate < entity.CorrectiveActionCompletionTargetDate)
                {
                    results.AddEntityError("The corrective action must be completed on or before the target resolution date");
                }
            }

            if (entity.TargetResolutionDate != null & entity.PreventativeActionCompletionTargetDate != null)
            {
                if (entity.TargetResolutionDate < entity.PreventativeActionCompletionTargetDate)
                {
                    results.AddEntityError("The preventative action must be completed on or before the target resolution date");
                }
            }
        }
    /// <summary>
    /// Initializes header menu.
    /// </summary>
    /// <param name="issue">Issue object</param>
    protected void InitalizeMenu(Issue issue)
    {
        // Get newsletter
        Newsletter news = NewsletterProvider.GetNewsletter(issue.IssueNewsletterID);
        if (news == null)
        {
            return;
        }

        InitTabs(3, "newsletterIssueContent");

        // Show only 'Send' tab for dynamic newsletter
        if (news.NewsletterType == NewsletterType.Dynamic)
        {
            SetTab(0, GetString("Newsletter_Issue_Header.Send"), "Newsletter_Issue_Send.aspx?issueid=" + issue.IssueID, "SetHelpTopic('helpTopic', 'send_tab');");

            // Set proper context help page
            SetHelp("send_tab", "helpTopic");
        }
        else
        {
            // Show 'Edit' and 'Send' tabs only to authorized users
            if (CMSContext.CurrentUser.IsAuthorizedPerResource("cms.newsletter", "authorissues"))
            {
                SetTab(0, GetString("General.Edit"), "Newsletter_Issue_Edit.aspx?issueid=" + issue.IssueID, "SetHelpTopic('helpTopic', 'edit_tab');");
                SetTab(1, GetString("Newsletter_Issue_Header.Send"), "Newsletter_Issue_Send.aspx?issueid=" + issue.IssueID, "SetHelpTopic('helpTopic', 'send_tab');");
            }
            // Add 'Preview' tab
            SetTab(2, GetString("Newsletter_Issue_Header.Preview"), "Newsletter_Issue_Preview.aspx?issueid=" + issue.IssueID, "SetHelpTopic('helpTopic', 'preview_tab');");
        }
    }
        public CommitForm(Issue issue, int ticks, string Comment, int activityId, DateTime spentOn)
        {
            InitializeComponent();
            LangTools.UpdateControlsForLanguage(this.Controls);
            Text = Lang.CommitConfirmQuestion;

            this.issue = issue;
            this.ticks = ticks;
            this.Comment = Comment;
            this.activityId = activityId;
            this.spentOn = spentOn;

            labelProjectContent.Text = issue.Project.Name;
            labelIssueContent.Text = String.Format("({0}) {1}", issue.Id, issue.Subject);
            if (labelIssueContent.Size.Width > Size.Width - labelIssueContent.Location.X - 10)
                this.Size = new Size(labelIssueContent.Location.X + labelIssueContent.Size.Width + 10, this.Size.Height);

            ComboBoxActivity.DataSource = Enumerations.Activities;
            ComboBoxActivity.DisplayMember = "Name";
            ComboBoxActivity.ValueMember = "Id";
            ComboBoxActivity.SelectedValue = activityId;

            labelTimeContent.Text = String.Format("{0:0.##}", (double)ticks / 3600);
            labelDateSpentContent.Text = spentOn.ToString(Lang.Culture.DateTimeFormat.ShortDatePattern);

            TextBoxComment.Text = Comment;

            if (RedmineClientForm.RedmineVersion < ApiVersion.V13x)
            {
                CheckBoxClosesIssue.Enabled = false;
                CheckBoxClosesIssue.Visible = false;
            }
        }
Esempio n. 8
0
 private Worklog(long? id, Issue issue, DateTime start, TimeSpan duration)
 {
    Id = id;
    Issue = issue;
    Start = start;
    Duration = duration;
 }
Esempio n. 9
0
 public TaskModel(ISourceControl sourceControl, IIssuesTracking issuesTracking, IRepositoryFactory repositoryFactory, Issue issue)
 {
     _sourceControl = sourceControl;
     _issuesTracking = issuesTracking;
     _repositoryFactory = repositoryFactory;
     Issue = issue;
 }
Esempio n. 10
0
        public void RedmineAttachments_ShouldUploadAttachment()
        {
            //read document from specified path
            string documentPath = "E:\\uploadAttachment.txt";
            byte[] documentData = File.ReadAllBytes(documentPath);

            //upload attachment to redmine
            Upload attachment = redmineManager.UploadFile(documentData);

            //set attachment properties
            attachment.FileName = "AttachmentUploaded.txt";
            attachment.Description = "File uploaded using REST API";
            attachment.ContentType = "text/plain";

            //create list of attachments to be added to issue
            IList<Upload> attachments = new List<Upload>();
            attachments.Add(attachment);

            //read document from specified path
            documentPath = "E:\\uploadAttachment1.txt";
            documentData = File.ReadAllBytes(documentPath);

            //upload attachment to redmine
            Upload attachment1 = redmineManager.UploadFile(documentData);

            //set attachment properties
            attachment1.FileName = "AttachmentUploaded1.txt";
            attachment1.Description = "Second file uploaded";
            attachment1.ContentType = "text/plain";
            attachments.Add(attachment1);

            Issue issue = new Issue();
            issue.Project = new Project { Id = 10 };
            issue.Tracker = new IdentifiableName { Id = 4 };
            issue.Status = new IdentifiableName { Id = 5 };
            issue.Priority = new IdentifiableName { Id = 8 };
            issue.Subject = "Issue with attachments";
            issue.Description = "Issue description...";
            issue.Category = new IdentifiableName { Id = 11 };
            issue.FixedVersion = new IdentifiableName { Id = 9 };
            issue.AssignedTo = new IdentifiableName { Id = 8 };
            issue.ParentIssue = new IdentifiableName { Id = 19 };
            issue.CustomFields = new List<IssueCustomField>();
            issue.CustomFields.Add(new IssueCustomField { Id = 13, Values = new List<CustomFieldValue> { new CustomFieldValue { Info = "Issue custom field completed" } } });
            issue.IsPrivate = true;
            issue.EstimatedHours = 12;
            issue.StartDate = DateTime.Now;
            issue.DueDate = DateTime.Now.AddMonths(1);
            issue.Uploads = attachments;
            issue.Watchers = new List<Watcher>();
            issue.Watchers.Add(new Watcher { Id = 8 });
            issue.Watchers.Add(new Watcher { Id = 2 });

            //create issue and attach document
            Issue issueWithAttachment = redmineManager.CreateObject<Issue>(issue);

            issue = redmineManager.GetObject<Issue>(issueWithAttachment.Id.ToString(), new NameValueCollection { { "include", "attachments" } });

            Assert.IsTrue(issue.Attachments.Count == 2 && issue.Attachments[0].FileName == attachment.FileName);
        }
Esempio n. 11
0
        public void UpdateIssue()
        {
            int projectId = FirstProjectId;

            string originalSummary = GetRandomSummary();
            string newSummary = GetRandomSummary();

            string originalDescription = GetRandomDescription();
            string newDescription = GetRandomDescription();

            Issue issue = new Issue();
            issue.Project = new ObjectRef( projectId );
            issue.Summary = originalSummary;
            issue.Description = originalDescription;
            issue.Category = new ObjectRef( GetFirstCategory( projectId ) );

            int issueId = Session.Request.IssueAdd( issue );

            try
            {
                Issue issueToUpdate = Session.Request.IssueGet(issueId);
                issueToUpdate.Summary = newSummary;
                issueToUpdate.Description = newDescription;
                Session.Request.IssueUpdate(issueToUpdate);

                Issue updatedIssue = Session.Request.IssueGet(issueId);
                Assert.AreEqual(newSummary, updatedIssue.Summary);
                Assert.AreEqual(newDescription, updatedIssue.Description);
            }
            finally
            {
                Session.Request.IssueDelete(issueId);
            }
        }
        public bool Create()
        {
            try
            {
                RedmineManager manager = new RedmineManager(Configuration.RedmineHost,
                    Configuration.RedmineUser, Configuration.RedminePassword);

                //Create a issue.
                var newIssue = new Issue
                {
                    Subject = Title,
                    Description = Description,
                    Project = new IdentifiableName() { Id = ProjectId },
                    Tracker = new IdentifiableName() { Id = TrackerId }
                };

                User thisuser = (from u in manager.GetObjectList<User>(new System.Collections.Specialized.NameValueCollection())
                                 where u.Login == Configuration.RedmineUser
                                 select u).FirstOrDefault();
                if (thisuser != null)
                    newIssue.AssignedTo = new IdentifiableName() { Id = thisuser.Id };

                manager.CreateObject(newIssue);
            }
            catch { return false; }
            return true;
        }
		public RedmineIssueStorage(Issue issue) {
			id = issue.Id;
			tracker = issue.Tracker.Name;
			subject = issue.Subject;
			project = issue.Project.Name;
			projectid = issue.Project.Id;
		}
        public void CreateDetailTransactionsForErrorCorrection(Order order, BLL.PickList picklist,
                                        Issue stvLog, int receiptPalletId, int receiptID, User user, DateTime convertedEthDate
                                        , int newItemId, int newUnitId, int newManufacturerId, decimal pickedPack
                                        , decimal Convertedpack, int confirmationStatusId, bool changeExpiryDate
                                        , DateTime? ExpiryDate, bool changeBatchNo, string batchNo)
        {
            //Load the ReceivePallet First From that we Get the Information that We need
            ReceivePallet receivePalletOriginal = new ReceivePallet();
            receivePalletOriginal.LoadByPrimaryKey(receiptPalletId);

            ReceiveDoc receiveDocOriginal = new ReceiveDoc();
            receiveDocOriginal.LoadByPrimaryKey(receivePalletOriginal.ReceiveID);

            //Load ItemUnit Detail for For ItemUnit Change;
            ItemUnit newItemUnit = new ItemUnit();
            newItemUnit.LoadByPrimaryKey(newUnitId);

              // Generate PicklistDetail With OrderDetail information
            PickListService pickListService = new PickListService();
            PickListDetail pickListDetail = pickListService.CreatePicklistDetailWithOrder(receiveDocOriginal, receivePalletOriginal, order, picklist,
                                                          pickedPack);
            // Generate IssueDoc from picklistDetail and substract the quantity from receiveDoc
            IssueService issueService = new IssueService();
            issueService.CreateIssueFromPicklist(pickListDetail, order, convertedEthDate, stvLog, user);

            if (Convertedpack > 0)
            {
                //duplicate The ReceiveDoc and ReceiptPallet
                ReceiveService receiveService = new ReceiveService();
                receiveService.CloneReceiveForErrorCorrection(confirmationStatusId, receivePalletOriginal, receiveDocOriginal
                                                                , Convertedpack, user, newItemId
                                                                , receiveDocOriginal.StoreID, receiptID
                                                                , newManufacturerId, newItemUnit, convertedEthDate,changeExpiryDate,ExpiryDate,changeBatchNo,batchNo);
            }
        }
Esempio n. 15
0
        public void RedmineIssues_ShouldCreateIssue()
        {
            Issue issue = new Issue();
            issue.Project = new Project { Id = 10 };
            issue.Tracker = new IdentifiableName { Id = 4 };
            issue.Status = new IdentifiableName { Id = 5 };
            issue.Priority = new IdentifiableName { Id = 8 };
            issue.Subject = "Issue created using Rest API";
            issue.Description = "Issue description...";
            issue.Category = new IdentifiableName { Id = 11 };
            issue.FixedVersion = new IdentifiableName { Id = 9 };
            issue.AssignedTo = new IdentifiableName { Id = 8 };
            issue.ParentIssue = new IdentifiableName { Id = 19 };
            issue.CustomFields = new List<IssueCustomField>();
            issue.CustomFields.Add(new IssueCustomField { Id = 13, Values = new List<CustomFieldValue> { new CustomFieldValue { Info = "Issue custom field completed" } } });

            issue.IsPrivate = true;
            issue.EstimatedHours = 12;
            issue.StartDate = DateTime.Now;
            issue.DueDate = DateTime.Now.AddMonths(1);
            issue.Watchers = new List<Watcher>();

            issue.Watchers.Add(new Watcher { Id = 8 });
            issue.Watchers.Add(new Watcher { Id = 2 });
            Issue savedIssue = redmineManager.CreateObject<Issue>(issue);

            Assert.AreEqual(issue.Subject, savedIssue.Subject);
        }
        public ExcelIssue CadastrarIssue(ExcelIssue atualExcelIssue, bool atualizarProjetoExistente)
        {
            Issue issueLoaded = null;
            Issue issueNew;
            Issue issueToSave = null;

            issueNew = new Issue
            {
                Id = atualExcelIssue.IdRedmine,
                Subject = atualExcelIssue.Subject,
                EstimatedHours = atualExcelIssue.EstimatedHours,
                StartDate = atualExcelIssue.StartDate,
                DueDate = atualExcelIssue.DueDate,
                AssignedTo = new IdentifiableName { Id = atualExcelIssue.AssigneeId },
                Tracker = new IdentifiableName { Id = atualExcelIssue.TrackerId },
                Project = new IdentifiableName { Id = atualExcelIssue.ProjectId },
                ParentIssue = atualExcelIssue.ParentExcelIssue != null && atualExcelIssue.ParentExcelIssue.IdRedmine != 0 ?
                    new IdentifiableName { Id = atualExcelIssue.ParentExcelIssue.IdRedmine } : null
            };

            if (atualizarProjetoExistente && atualExcelIssue.IdRedmine != 0)
            {
                try
                {
                    issueLoaded = manager.GetObject<Issue>(atualExcelIssue.IdRedmine.ToString(), null);
                    issueToSave = AtualizarSomenteModificacoes(issueLoaded, issueNew);
                }
                catch(RedmineException rex)
                {
                    Console.WriteLine("Mensagem de erro do sistema ao tentar carregar a Issue Id " + atualExcelIssue.IdRedmine.ToString() + ": " + rex.Message);
                    throw new Exception("O ID da Issue/Atividade sendo atualizada não foi encontrada no Redmine!");
                }
            }
            else
                issueToSave = issueNew;

            try
            {
                if (!atualizarProjetoExistente)
                {
                    issueToSave = manager.CreateObject(issueToSave);
                    atualExcelIssue.IdRedmine = issueToSave.Id;
                }
                else if (issueToSave.Id != 0)
                    manager.UpdateObject(issueToSave.Id.ToString(), issueToSave);
            }
            catch(RedmineException rex)
            {
                if (rex.Message.Contains("Tracker is not included in the list"))
                {
                    throw new Exception("Tracker Not Found");
                }
                else {
                    throw rex;
                }
            }

            return atualExcelIssue;
        }
Esempio n. 17
0
 public ActionResult Create(Issue issue)
 {
     string imageData = Request.Form.Get("image");
     issue.Images.Add(imageData);
     DocumentSession.Store(issue);
     DocumentSession.SaveChanges();
     return Json(issue);
 }
 public static void AttachScreenShot(Issue issue, Image img)
 {
     if (img != null)
     {
         issue.AddAttachment("screenshot.png", ConvertImage(img));
     }
     issue.SaveChanges();
 }
 public async Task<HttpResponseMessage> Post(Issue issue)
 {
     HttpResponseMessage response = null;
     await _service.CreateIssue(
         issue.CreatedBy,
         item => response = Request.CreateResponse(HttpStatusCode.Created, new {Uri = string.Format("/Issues/{0}", item.IssueId)}));
     return response;
 }
 public TimeEntriesForm(Issue issue, IList<ProjectMember> projectMembers)
 {
     this.issue = issue;
     this.projectMembers = projectMembers;
     InitializeComponent();
     this.Text = String.Format(Lang.DlgTimeEntriesTitle, issue.Id, issue.Subject);
     LangTools.UpdateControlsForLanguage(this.Controls);
 }
Esempio n. 21
0
        public void AddCustomFieldToIssue(Issue issue, string fieldName, string value)
        {
            var issueToUpdate = _instance.GetIssue(issue.Key.ToString());

            issueToUpdate[fieldName] = value;

            issueToUpdate.SaveChanges();
        }
Esempio n. 22
0
 public void SendMessage(int chatid, Issue tc)
 {
     SendMessage(chatid, tc.Key + System.Environment.NewLine
         + tc.Reporter + System.Environment.NewLine
         + tc.Priority.Name + System.Environment.NewLine
         + tc.Summary + System.Environment.NewLine
         + tc.Description, "{\"keyboard\": [[\"Распределить\"], [\"Решить\"], [\"Назначить себе\"]],\"resize_keyboard\":true,\"one_time_keyboard\":true}");
 }
 public ClientIssueRelation(IssueRelation relation, Issue issueTo)
 {
     this.Id = relation.Id;
     this.IssueId = relation.IssueId;
     this.IssueToId = relation.IssueToId;
     this.Type = relation.Type;
     this.issueTo = issueTo;
 }
Esempio n. 24
0
 public static Change For(Issue issue, User editingUser, string comment)
 {
     return new Change
            	{
            		EditedBy = editingUser,
            		AppliesTo = issue,
            		Comments = comment
            	};
 }
 public void RemoveIssue(Issue issue)
 {
     this.UserName_Issues[this.CurrentUser.UserName].Remove(issue);
     foreach (var tag in issue.Tags)
     {
         this.Tag_Issues[tag].Remove(issue);
     }
     this.IssueId_Issue.Remove(issue.Id);
 }
 public AttachmentForm(Issue issue, DialogType type, string path)
 {
     InitializeComponent();
     this.type = type;
     this.issue = issue;
     textBoxAttachmentFilePath.Text = path;
     LangTools.UpdateControlsForLanguage(this.Controls);
     this.Text = String.Format(Lang.DlgAttachmentTitle, issue.Id, issue.Subject);
 }
        public UpdateIssueNoteForm(Issue fromIssue, Issue toIssue)
        {
            this.fromIssue = fromIssue;
            this.toIssue = toIssue;
            InitializeComponent();

            this.Text = String.Format(Lang.DlgUpdateIssueNoteTitle, toIssue.Id, toIssue.Subject);
            LangTools.UpdateControlsForLanguage(this.Controls);
        }
 public void RemoveIssue(Issue issue)
 {
     this.IssuesByUsername[this.CurrentUser.Username].Remove(issue);
     foreach (var tag in issue.Tags)
     {
         this.IssuesByTag[tag].Remove(issue);
     }
     this.IssuesById.Remove(issue.Id);
 }
Esempio n. 29
0
 public void RemoveIssue(Issue problem)
 {
     this.IssuesById.Remove(problem.Id);
     this.IssuesByUser.Remove(this.CurrentUser, problem);
     foreach (var tag in problem.Tags)
     {
         this.IssuesByTag.Remove(tag, problem);
     }
 }
 public IssueWithDispositionModel(Issue anIssue)
 {
     Issue = anIssue;
     TotalAgrees = (from d in anIssue.IssueDispositions
                    where d.Disposition == (int)Disposition.Like
                    select d).Count<IssueDisposition>();
     TotalDisagrees = (from d in anIssue.IssueDispositions
                       where d.Disposition == (int)Disposition.Dislike
                       select d).Count<IssueDisposition>();
 }
Esempio n. 31
0
        /// <summary>
        /// Saves the issue.
        /// </summary>
        /// <returns></returns>
        private bool SaveIssue()
        {
            decimal estimation;

            decimal.TryParse(txtEstimation.Text.Trim(), out estimation);
            var dueDate = DueDatePicker.SelectedValue == null ? DateTime.MinValue : (DateTime)DueDatePicker.SelectedValue;

            // WARNING: DO NOT ENCODE THE HTMLEDITOR TEXT.
            // It expects raw input. So pass through a raw string.
            // This is a potential XSS vector as the Issue Class should
            // handle sanitizing the input and checking that its input is HtmlEncoded
            // (ie no < or > characters), not the IssueDetail.aspx.cs

            var issue = new Issue
            {
                AffectedMilestoneId       = DropAffectedMilestone.SelectedValue,
                AffectedMilestoneImageUrl = string.Empty,
                AffectedMilestoneName     = DropAffectedMilestone.SelectedText,
                AssignedDisplayName       = DropAssignedTo.SelectedText,
                AssignedUserId            = Guid.Empty,
                AssignedUserName          = DropAssignedTo.SelectedValue,
                CategoryId         = DropCategory.SelectedValue,
                CategoryName       = DropCategory.SelectedText,
                CreatorDisplayName = Security.GetDisplayName(),
                CreatorUserId      = Guid.Empty,
                CreatorUserName    = Security.GetUserName(),
                DateCreated        = DateTime.Now,
                Description        = DescriptionHtmlEditor.Text.Trim(),
                Disabled           = false,
                DueDate            = dueDate,
                Estimation         = estimation,
                Id                    = IssueId,
                IsClosed              = false,
                IssueTypeId           = DropIssueType.SelectedValue,
                IssueTypeName         = DropIssueType.SelectedText,
                IssueTypeImageUrl     = string.Empty,
                LastUpdate            = DateTime.Now,
                LastUpdateDisplayName = Security.GetDisplayName(),
                LastUpdateUserName    = Security.GetUserName(),
                MilestoneDueDate      = null,
                MilestoneId           = DropMilestone.SelectedValue,
                MilestoneImageUrl     = string.Empty,
                MilestoneName         = DropMilestone.SelectedText,
                OwnerDisplayName      = DropOwned.SelectedText,
                OwnerUserId           = Guid.Empty,
                OwnerUserName         = DropOwned.SelectedValue,
                PriorityId            = DropPriority.SelectedValue,
                PriorityImageUrl      = string.Empty,
                PriorityName          = DropPriority.SelectedText,
                Progress              = Convert.ToInt32(ProgressSlider.Text),
                ProjectCode           = string.Empty,
                ProjectId             = ProjectId,
                ProjectName           = string.Empty,
                ResolutionId          = DropResolution.SelectedValue,
                ResolutionImageUrl    = string.Empty,
                ResolutionName        = DropResolution.SelectedText,
                StatusId              = DropStatus.SelectedValue,
                StatusImageUrl        = string.Empty,
                StatusName            = DropStatus.SelectedText,
                Title                 = Server.HtmlEncode(TitleTextBox.Text),
                TimeLogged            = 0,
                Visibility            = chkPrivate.Checked ? 1 : 0,
                Votes                 = 0
            };

            if (!IssueManager.SaveOrUpdate(issue))
            {
                Message1.ShowErrorMessage(Resources.Exceptions.SaveIssueError);
                return(false);
            }

            IssueId = issue.Id;

            if (!CustomFieldManager.SaveCustomFieldValues(IssueId, ctlCustomFields.Values))
            {
                Message1.ShowErrorMessage(Resources.Exceptions.SaveCustomFieldValuesError);
                return(false);
            }

            return(true);
        }
Esempio n. 32
0
        /// <summary>
        /// Generates dummy issues for our dummy admin.
        /// </summary>
        /// <returns></returns>
        public async Task GenerateDummyIssues()
        {
            //if dummy method was not called before
            if (await _db.Issues.SingleOrDefaultAsync(i => i.Subject.ToLower().Equals("epicTestIssue1")) == null)
            {
                var ted = await _db.Users.SingleOrDefaultAsync(u => u.UserName.Equals("Ted"));

                var bob = await _db.Users.SingleOrDefaultAsync(u => u.UserName.Equals("Bob"));

                var jan = await _db.Users.SingleOrDefaultAsync(u => u.UserName.Equals("Jan"));

                var louis = await _db.Users.SingleOrDefaultAsync(u => u.UserName.Equals("Louis"));

                var issueList = new List <Issue>
                {
                    new Issue
                    {
                        Creator         = ted,
                        Subject         = "epicTestIssue1",
                        Description     = "Issue1",
                        IssueStatusCode = IssueStatusCode.New,
                        PriorityCode    = PriorityCode.immediate,
                        Occurrence      = DateTime.Now.AddDays(-10),
                        Registered      = DateTime.Now
                    },
                    new Issue
                    {
                        Creator         = bob,
                        Subject         = "Issue2",
                        Description     = "Issue2",
                        IssueStatusCode = IssueStatusCode.New,
                        PriorityCode    = PriorityCode.low,
                        Occurrence      = DateTime.Now.AddDays(-5),
                        Registered      = DateTime.Now
                    },
                    new Issue
                    {
                        Creator         = louis,
                        Subject         = "Issue3",
                        Description     = "Issue3",
                        IssueStatusCode = IssueStatusCode.New,
                        PriorityCode    = PriorityCode.low,
                        Occurrence      = DateTime.Now.AddDays(-5),
                        Registered      = DateTime.Now,
                        ResponsibleUser = louis
                    }
                };

                var issueWithHistory = new Issue
                {
                    Creator         = louis,
                    Subject         = "Issue4",
                    Description     = "Issue4",
                    IssueStatusCode = IssueStatusCode.Solved,
                    PriorityCode    = PriorityCode.low,
                    Occurrence      = DateTime.Now.AddDays(-15),
                    Registered      = DateTime.Now.AddDays(-10),
                    ResponsibleUser = jan
                };

                foreach (var issue in issueList)
                {
                    _db.Issues.Add(issue);
                }

                var histories = new List <IssueHistory>
                {
                    new IssueHistory
                    {
                        Comment   = "Issue created in database",
                        CreatedOn = DateTime.Now.AddDays(-9),
                        Issue     = issueWithHistory,
                        Status    = IssueStatusCode.New,
                        User      = louis
                    },
                    new IssueHistory
                    {
                        Comment   = "Issue assigned to user",
                        CreatedOn = DateTime.Now.AddDays(-8),
                        Issue     = issueWithHistory,
                        Status    = IssueStatusCode.Processing,
                        User      = bob
                    },
                    new IssueHistory
                    {
                        Comment   = "Issue solved by solver",
                        CreatedOn = DateTime.Now.AddDays(-5),
                        Issue     = issueWithHistory,
                        Status    = IssueStatusCode.Solved,
                        User      = jan
                    }
                };

                foreach (var history in histories)
                {
                    _db.Histories.Add(history);
                }

                await _db.SaveAsync();
            }
        }
        private Issue CreateIssue(IExecutionContext context, string issueType, String message, Dictionary <String, String> properties)
        {
            Issue issue = new Issue()
            {
                Category = "General",
            };

            if (issueType.Equals("error", StringComparison.OrdinalIgnoreCase))
            {
                issue.Type = IssueType.Error;
            }
            else if (issueType.Equals("warning", StringComparison.OrdinalIgnoreCase))
            {
                issue.Type = IssueType.Warning;
            }
            else
            {
                throw new Exception($"issue type {issueType} is not an expected issue type.");
            }

            String sourcePath;

            if (properties.TryGetValue(ProjectIssueProperties.SourcePath, out sourcePath))
            {
                issue.Category = "Code";

                var           extensionManager = HostContext.GetService <IExtensionManager>();
                var           hostType         = context.Variables.System_HostType;
                IJobExtension extension        =
                    (extensionManager.GetExtensions <IJobExtension>() ?? new List <IJobExtension>())
                    .Where(x => x.HostType.HasFlag(hostType))
                    .FirstOrDefault();

                if (extension != null)
                {
                    if (context.Container != null)
                    {
                        // Translate file path back from container path
                        sourcePath = context.Container.TranslateToHostPath(sourcePath);
                        properties[ProjectIssueProperties.SourcePath] = sourcePath;
                    }

                    // Get the values that represent the server path given a local path
                    string repoName;
                    string relativeSourcePath;
                    extension.ConvertLocalPath(context, sourcePath, out repoName, out relativeSourcePath);

                    // add repo info
                    if (!string.IsNullOrEmpty(repoName))
                    {
                        properties["repo"] = repoName;
                    }

                    if (!string.IsNullOrEmpty(relativeSourcePath))
                    {
                        // replace sourcePath with the new relative path
                        properties[ProjectIssueProperties.SourcePath] = relativeSourcePath;
                    }

                    String sourcePathValue;
                    String lineNumberValue;
                    String columnNumberValue;
                    String messageTypeValue;
                    String codeValue;
                    properties.TryGetValue(TaskIssueEventProperties.Type, out messageTypeValue);
                    properties.TryGetValue(ProjectIssueProperties.SourcePath, out sourcePathValue);
                    properties.TryGetValue(ProjectIssueProperties.LineNumber, out lineNumberValue);
                    properties.TryGetValue(ProjectIssueProperties.ColumNumber, out columnNumberValue);
                    properties.TryGetValue(ProjectIssueProperties.Code, out codeValue);

                    //ex. Program.cs(13, 18): error CS1002: ; expected
                    message = String.Format(CultureInfo.InvariantCulture, "{0}({1},{2}): {3} {4}: {5}",
                                            sourcePathValue,
                                            lineNumberValue,
                                            columnNumberValue,
                                            messageTypeValue,
                                            codeValue,
                                            message);
                }
            }

            if (properties != null)
            {
                foreach (var property in properties)
                {
                    issue.Data[property.Key] = property.Value;
                }
            }

            issue.Message = message;

            return(issue);
        }
        private Issue GetIssue(Issue issue)
        {
            var overrideUrl = String.Format(_issuesIdUrl, issue.local_id);

            return(_sharpBucketV1.Get <Issue>(overrideUrl));
        }
Esempio n. 35
0
 public Task <Issue> DeleteIssueAsync(Issue issue, CancellationToken cancellationToken = default(CancellationToken))
 {
     throw new NotImplementedException();
 }
        internal Issue DeleteIssue(Issue issue)
        {
            var overrideUrl = String.Format(_issuesIdUrl, issue.local_id);

            return(_sharpBucketV1.Delete <Issue>(overrideUrl));
        }
 internal Issue PostIssue(Issue issue)
 {
     return(_sharpBucketV1.Post(issue, _issuesUrl));
 }
Esempio n. 38
0
            public void Should_Read_Correct_Number_Of_Issues_From_Multiple_Providers()
            {
                // Given
                var issue1 =
                    new Issue(
                        @"src\Cake.Issues.Tests\FakeIssueProvider.cs",
                        10,
                        "Foo",
                        0,
                        "Foo",
                        "Foo");
                var issue2 =
                    new Issue(
                        @"src\Cake.Issues.Tests\FakeIssueProvider.cs",
                        12,
                        "Bar",
                        0,
                        "Bar",
                        "Bar");
                var issue3 =
                    new Issue(
                        @"src\Cake.Issues.Tests\Foo.cs",
                        5,
                        "Foo",
                        0,
                        "Foo",
                        "Foo");
                var issue4 =
                    new Issue(
                        @"src\Cake.Issues.Tests\Bar.cs",
                        7,
                        "Bar",
                        0,
                        "Bar",
                        "Bar");
                var fixture = new IssuesFixture();

                fixture.IssueProviders.Clear();
                fixture.IssueProviders.Add(
                    new FakeIssueProvider(
                        fixture.Log,
                        new List <IIssue>
                {
                    issue1,
                    issue2
                }));
                fixture.IssueProviders.Add(
                    new FakeIssueProvider(
                        fixture.Log,
                        new List <IIssue>
                {
                    issue3,
                    issue4
                }));

                // When
                var issues = fixture.ReadIssues(IssueCommentFormat.Undefined).ToList();

                // Then
                issues.Count.ShouldBe(4);
                issues.ShouldContain(issue1);
                issues.ShouldContain(issue2);
                issues.ShouldContain(issue3);
                issues.ShouldContain(issue4);
            }
Esempio n. 39
0
        private async void SaveButton(object sender, RoutedEventArgs e)
        {
            if (DataModel.HasModifiedRunDate)
            {
                if (!DataModel.RunDate.HasValue)
                {
                    await modelHelpers.ShowMessageAsync("Missing Date", "You Must Enter A Start Date");

                    Focus();
                    return;
                }

                if (DataModel.RunDate.Value.Date < DataModel.MinDate.Date || DataModel.RunDate.Value.Date > DataModel.MaxDate.Date)
                {
                    await modelHelpers.ShowMessageAsync("Invalid Date", $"You Must Enter A Start Date Between {DataModel.MinDate.ToShortDateString()} And {DataModel.MaxDate.ToShortDateString()}");

                    Focus();
                    return;
                }

                try
                {
                    EditedTimerId = modelHelpers.Gallifrey.JiraTimerCollection.ChangeTimerDate(EditedTimerId, DataModel.RunDate.Value);
                }
                catch (DuplicateTimerException ex)
                {
                    var handled = await MergeTimers(ex);

                    if (!handled)
                    {
                        Focus();
                        return;
                    }
                }
            }
            else if (DataModel.HasModifiedJiraReference)
            {
                if (DataModel.LocalTimer)
                {
                    try
                    {
                        EditedTimerId = modelHelpers.Gallifrey.JiraTimerCollection.ChangeLocalTimerDescription(EditedTimerId, DataModel.LocalTimerDescription);
                    }
                    catch (DuplicateTimerException)
                    {
                        await modelHelpers.ShowMessageAsync("Something Went Wrong", "An Error Occured Trying To Edit That Timer, Please Try Again");

                        Focus();
                        return;
                    }
                }
                else
                {
                    Issue jiraIssue = null;
                    var   jiraRef   = DataModel.JiraReference;

                    void GetIssue()
                    {
                        if (modelHelpers.Gallifrey.JiraConnection.DoesJiraExist(jiraRef))
                        {
                            jiraIssue = modelHelpers.Gallifrey.JiraConnection.GetJiraIssue(jiraRef);
                        }
                    }

                    var jiraDownloadResult = await progressDialogHelper.Do(GetIssue, "Searching For Jira Issue", true, false);

                    if (jiraDownloadResult.Status == ProgressResult.JiraHelperStatus.Cancelled)
                    {
                        Focus();
                        return;
                    }

                    if (jiraIssue == null)
                    {
                        await modelHelpers.ShowMessageAsync("Invalid Jira", $"Unable To Locate The Jira '{jiraRef}'");

                        Focus();
                        return;
                    }

                    var result = await modelHelpers.ShowMessageAsync("Correct Jira?", $"Jira found!\n\nRef: {jiraIssue.key}\nName: {jiraIssue.fields.summary}\n\nIs that correct?", MessageDialogStyle.AffirmativeAndNegative, new MetroDialogSettings { AffirmativeButtonText = "Yes", NegativeButtonText = "No", DefaultButtonFocus = MessageDialogResult.Affirmative });

                    if (result == MessageDialogResult.Negative)
                    {
                        return;
                    }

                    try
                    {
                        EditedTimerId = modelHelpers.Gallifrey.JiraTimerCollection.RenameTimer(EditedTimerId, jiraIssue);
                    }
                    catch (DuplicateTimerException ex)
                    {
                        var handled = await MergeTimers(ex);

                        if (!handled)
                        {
                            Focus();
                            return;
                        }
                    }
                }
            }

            if (DataModel.HasModifiedTime)
            {
                var originalTime = new TimeSpan(DataModel.OriginalHours, DataModel.OriginalMinutes, 0);
                var newTime      = new TimeSpan(DataModel.Hours ?? 0, DataModel.Minutes ?? 0, 0);
                var difference   = newTime.Subtract(originalTime);
                var addTime      = difference.TotalSeconds > 0;

                modelHelpers.Gallifrey.JiraTimerCollection.AdjustTime(EditedTimerId, Math.Abs(difference.Hours), Math.Abs(difference.Minutes), addTime);
            }

            modelHelpers.RefreshModel();
            modelHelpers.SetSelectedTimer(EditedTimerId);
            modelHelpers.CloseFlyout(this);
        }
Esempio n. 40
0
 private static void updateEnvironment(Issue issue, string envString)
 {
     issue.Environment = envString;
 }
Esempio n. 41
0
 private static void addRanorexReport(Issue issue)
 {
     addRanorexReport(issue, Ranorex.Core.Reporting.TestReport.ReportEnvironment.ReportViewFilePath);
 }
Esempio n. 42
0
        /// <summary>
        /// Main command entry point
        /// </summary>
        /// <param name="Arguments">The command line arguments</param>
        public override void Exec(CommandLineArguments Arguments)
        {
            // Parse the arguments
            bool               bClean           = Arguments.HasOption("-Clean");
            string             PerforcePort     = Arguments.GetStringOrDefault("-P4Port=", null);
            string             PerforceUser     = Arguments.GetStringOrDefault("-P4User="******"-InputFile=", null);
            FileReference      StateFile        = Arguments.GetFileReference("-StateFile=");
            string             ServerUrl        = Arguments.GetStringOrDefault("-Server=", null);
            bool               bKeepHistory     = Arguments.HasOption("-KeepHistory");
            bool               bReadOnly        = Arguments.HasOption("-ReadOnly");
            DirectoryReference SaveUnmatchedDir = Arguments.GetDirectoryReferenceOrDefault("-SaveUnmatched=", null);

            Arguments.CheckAllArgumentsUsed();

            // Build a mapping from category to matching
            Dictionary <string, PatternMatcher> CategoryNameToMatcher = new Dictionary <string, PatternMatcher>();

            foreach (PatternMatcher Matcher in Matchers)
            {
                CategoryNameToMatcher[Matcher.Category] = Matcher;
            }

            // Complete any interrupted operation to update the state file
            CompleteStateTransaction(StateFile);

            // Read the persistent data file
            BuildHealthState State;

            if (!bClean && FileReference.Exists(StateFile))
            {
                Log.TraceInformation("Reading persistent data from {0}", StateFile);
                State = DeserializeJson <BuildHealthState>(StateFile);
            }
            else
            {
                Log.TraceInformation("Creating new persistent data");
                State = new BuildHealthState();
            }

            // Fixup any issues loaded from disk
            foreach (BuildHealthIssue Issue in State.Issues)
            {
                if (Issue.References == null)
                {
                    Issue.References = new SortedSet <string>();
                }
            }

            // Create the Perforce connection
            PerforceConnection Perforce = new PerforceConnection(PerforcePort, PerforceUser, null);

            // Process the input data
            if (InputFile != null)
            {
                // Parse the input file
                Log.TraceInformation("Reading build results from {0}", InputFile);
                InputData InputData = DeserializeJson <InputData>(InputFile);

                // Parse all the builds and add them to the persistent data
                List <InputJob> InputJobs = InputData.Jobs.OrderBy(x => x.Change).ThenBy(x => x.Stream).ToList();
                Stopwatch       Timer     = Stopwatch.StartNew();
                foreach (InputJob InputJob in InputJobs)
                {
                    // Add a new build for each job step
                    foreach (InputJobStep InputJobStep in InputJob.Steps)
                    {
                        BuildHealthJobStep NewBuild = new BuildHealthJobStep(InputJob.Change, InputJob.Name, InputJob.Url, InputJobStep.Name, InputJobStep.Url, null);
                        State.AddBuild(InputJob.Stream, NewBuild);
                    }

                    // Add all the job steps
                    List <InputJobStep> InputJobSteps = InputJob.Steps.OrderBy(x => x.Name).ToList();
                    foreach (InputJobStep InputJobStep in InputJobSteps)
                    {
                        if (InputJobStep.Diagnostics != null && InputJobStep.Diagnostics.Count > 0)
                        {
                            AddStep(Perforce, State, InputJob, InputJobStep);
                        }
                    }

                    // Remove any steps which are empty
                    InputJob.Steps.RemoveAll(x => x.Diagnostics == null || x.Diagnostics.Count == 0);
                }
                InputJobs.RemoveAll(x => x.Steps.Count == 0);
                Log.TraceInformation("Added jobs in {0}s", Timer.Elapsed.TotalSeconds);

                // If there are any unmatched issues, save out the current state and remaining input
                if (SaveUnmatchedDir != null && InputJobs.Count > 0)
                {
                    DirectoryReference.CreateDirectory(SaveUnmatchedDir);
                    if (FileReference.Exists(StateFile))
                    {
                        FileReference.Copy(StateFile, FileReference.Combine(SaveUnmatchedDir, "State.json"), true);
                    }
                    SerializeJson(FileReference.Combine(SaveUnmatchedDir, "Input.json"), InputData);
                }

                // Try to find the next successful build for each stream, so we can close it as part of updating the server
                for (int Idx = 0; Idx < State.Issues.Count; Idx++)
                {
                    BuildHealthIssue Issue = State.Issues[Idx];
                    foreach (string Stream in Issue.Streams.Keys)
                    {
                        Dictionary <string, BuildHealthJobHistory> StepNameToHistory = Issue.Streams[Stream];
                        foreach (string StepName in StepNameToHistory.Keys)
                        {
                            BuildHealthJobHistory IssueHistory = StepNameToHistory[StepName];
                            if (IssueHistory.FailedBuilds.Count > 0 && IssueHistory.NextSuccessfulBuild == null)
                            {
                                // Find the successful build after this change
                                BuildHealthJobStep LastFailedBuild = IssueHistory.FailedBuilds[IssueHistory.FailedBuilds.Count - 1];
                                IssueHistory.NextSuccessfulBuild = State.FindBuildAfter(Stream, LastFailedBuild.Change, StepName);
                            }
                        }
                    }
                }

                // Find the change two days before the latest change being added
                if (InputData.Jobs.Count > 0 && !bKeepHistory)
                {
                    // Find all the unique change numbers for each stream
                    SortedSet <int> ChangeNumbers = new SortedSet <int>();
                    foreach (List <BuildHealthJobStep> Builds in State.Streams.Values)
                    {
                        ChangeNumbers.UnionWith(Builds.Select(x => x.Change));
                    }

                    // Get the latest change record
                    int          LatestChangeNumber = InputData.Jobs.Min(x => x.Change);
                    ChangeRecord LatestChangeRecord = Perforce.GetChange(GetChangeOptions.None, LatestChangeNumber).Data;

                    // Step forward through all the changelists until we get to one we don't want to delete
                    int DeleteChangeNumber = -1;
                    foreach (int ChangeNumber in ChangeNumbers)
                    {
                        ChangeRecord ChangeRecord = Perforce.GetChange(GetChangeOptions.None, ChangeNumber).Data;
                        if (ChangeRecord.Date > LatestChangeRecord.Date - TimeSpan.FromDays(2))
                        {
                            break;
                        }
                        DeleteChangeNumber = ChangeNumber;
                    }

                    // Remove any builds we no longer want to track
                    foreach (List <BuildHealthJobStep> Builds in State.Streams.Values)
                    {
                        Builds.RemoveAll(x => x.Change <= DeleteChangeNumber);
                    }
                }
            }

            // Mark any issues as resolved
            foreach (BuildHealthIssue Issue in State.Issues)
            {
                if (Issue.IsResolved())
                {
                    if (!Issue.ResolvedAt.HasValue)
                    {
                        Issue.ResolvedAt = DateTime.UtcNow;
                    }
                }
                else
                {
                    if (Issue.ResolvedAt.HasValue)
                    {
                        Issue.ResolvedAt = null;
                    }
                }
            }

            // If we're in read-only mode, don't write anything out
            if (bReadOnly)
            {
                return;
            }

            // Save the persistent data
            Log.TraceInformation("Writing persistent data to {0}", StateFile);
            DirectoryReference.CreateDirectory(StateFile.Directory);
            WriteState(StateFile, State);

            // Synchronize with the server
            if (ServerUrl != null)
            {
                // Post any issue updates
                foreach (BuildHealthIssue Issue in State.Issues)
                {
                    PatternMatcher Matcher;
                    if (!CategoryNameToMatcher.TryGetValue(Issue.Category, out Matcher))
                    {
                        continue;
                    }

                    string Summary = Matcher.GetSummary(Issue);
                    if (Issue.Id == -1)
                    {
                        Log.TraceInformation("Adding issue: {0}", Issue);

                        if (Issue.PendingWatchers.Count == 0)
                        {
                            Log.TraceWarning("(No possible causers)");
                        }

                        CommandTypes.AddIssue IssueBody = new CommandTypes.AddIssue();
                        IssueBody.Project = Issue.Project;
                        IssueBody.Summary = Summary;

                        if (Issue.PendingWatchers.Count == 1)
                        {
                            IssueBody.Owner = Issue.PendingWatchers.First();
                        }

                        using (HttpWebResponse Response = SendHttpRequest(String.Format("{0}/api/issues", ServerUrl), "POST", IssueBody))
                        {
                            int ResponseCode = (int)Response.StatusCode;
                            if (!(ResponseCode >= 200 && ResponseCode <= 299))
                            {
                                throw new Exception("Unable to add issue");
                            }
                            Issue.Id = ParseHttpResponse <CommandTypes.AddIssueResponse>(Response).Id;
                        }

                        Issue.PostedSummary = Summary;
                        WriteState(StateFile, State);
                    }
                    else if (Issue.PostedSummary == null || !String.Equals(Issue.PostedSummary, Summary, StringComparison.Ordinal))
                    {
                        Log.TraceInformation("Updating issue {0}", Issue.Id);

                        CommandTypes.UpdateIssue IssueBody = new CommandTypes.UpdateIssue();
                        IssueBody.Summary = Summary;

                        using (HttpWebResponse Response = SendHttpRequest(String.Format("{0}/api/issues/{1}", ServerUrl, Issue.Id), "PUT", IssueBody))
                        {
                            int ResponseCode = (int)Response.StatusCode;
                            if (!(ResponseCode >= 200 && ResponseCode <= 299))
                            {
                                throw new Exception("Unable to add issue");
                            }
                        }

                        Issue.PostedSummary = Summary;
                        WriteState(StateFile, State);
                    }
                }

                // Add any new builds associated with issues
                Dictionary <string, long> JobStepUrlToId = new Dictionary <string, long>(StringComparer.Ordinal);
                foreach (BuildHealthIssue Issue in State.Issues)
                {
                    foreach (KeyValuePair <string, Dictionary <string, BuildHealthJobHistory> > StreamPair in Issue.Streams)
                    {
                        foreach (BuildHealthJobHistory StreamHistory in StreamPair.Value.Values)
                        {
                            foreach (BuildHealthJobStep Build in StreamHistory.Builds)
                            {
                                if (!Build.bPostedToServer)
                                {
                                    Log.TraceInformation("Adding {0} to issue {1}", Build.JobStepUrl, Issue.Id);

                                    CommandTypes.AddBuild AddBuild = new CommandTypes.AddBuild();
                                    AddBuild.Stream      = StreamPair.Key;
                                    AddBuild.Change      = Build.Change;
                                    AddBuild.JobName     = Build.JobName;
                                    AddBuild.JobUrl      = Build.JobUrl;
                                    AddBuild.JobStepName = Build.JobStepName;
                                    AddBuild.JobStepUrl  = Build.JobStepUrl;
                                    AddBuild.ErrorUrl    = Build.ErrorUrl;
                                    AddBuild.Outcome     = (Build == StreamHistory.PrevSuccessfulBuild || Build == StreamHistory.NextSuccessfulBuild)? CommandTypes.Outcome.Success : CommandTypes.Outcome.Error;

                                    using (HttpWebResponse Response = SendHttpRequest(String.Format("{0}/api/issues/{1}/builds", ServerUrl, Issue.Id), "POST", AddBuild))
                                    {
                                        int ResponseCode = (int)Response.StatusCode;
                                        if (!(ResponseCode >= 200 && ResponseCode <= 299))
                                        {
                                            throw new Exception("Unable to add build");
                                        }
                                        Build.Id = ParseHttpResponse <CommandTypes.AddBuildResponse>(Response).Id;
                                    }

                                    Build.bPostedToServer = true;
                                    WriteState(StateFile, State);
                                }
                                if (Build.Id != -1)
                                {
                                    JobStepUrlToId[Build.JobStepUrl] = Build.Id;
                                }
                            }
                        }
                    }
                }

                // Add any new diagnostics
                foreach (BuildHealthIssue Issue in State.Issues)
                {
                    foreach (BuildHealthDiagnostic Diagnostic in Issue.Diagnostics)
                    {
                        if (!Diagnostic.bPostedToServer)
                        {
                            string Summary = Diagnostic.Message;

                            const int MaxLength = 40;
                            if (Summary.Length > MaxLength)
                            {
                                Summary = Summary.Substring(0, MaxLength).TrimEnd();
                            }

                            Log.TraceInformation("Adding diagnostic '{0}' to issue {1}", Summary, Issue.Id);

                            CommandTypes.AddDiagnostic AddDiagnostic = new CommandTypes.AddDiagnostic();

                            long BuildId;
                            if (Diagnostic.JobStepUrl != null && JobStepUrlToId.TryGetValue(Diagnostic.JobStepUrl, out BuildId))
                            {
                                AddDiagnostic.BuildId = BuildId;
                            }
                            else
                            {
                                Console.WriteLine("ERROR");
                            }

                            AddDiagnostic.Message = Diagnostic.Message;
                            AddDiagnostic.Url     = Diagnostic.ErrorUrl;

                            using (HttpWebResponse Response = SendHttpRequest(String.Format("{0}/api/issues/{1}/diagnostics", ServerUrl, Issue.Id), "POST", AddDiagnostic))
                            {
                                int ResponseCode = (int)Response.StatusCode;
                                if (!(ResponseCode >= 200 && ResponseCode <= 299))
                                {
                                    throw new Exception("Unable to add build");
                                }
                            }

                            Diagnostic.bPostedToServer = true;
                            WriteState(StateFile, State);
                        }
                    }
                }

                // Close any issues which are complete
                for (int Idx = 0; Idx < State.Issues.Count; Idx++)
                {
                    BuildHealthIssue Issue = State.Issues[Idx];
                    if (Issue.ResolvedAt.HasValue != Issue.bPostedResolved)
                    {
                        Log.TraceInformation("Setting issue {0} resolved flag to {1}", Issue.Id, Issue.ResolvedAt.HasValue);

                        CommandTypes.UpdateIssue UpdateBody = new CommandTypes.UpdateIssue();
                        UpdateBody.Resolved = Issue.ResolvedAt.HasValue;

                        using (HttpWebResponse Response = SendHttpRequest(String.Format("{0}/api/issues/{1}", ServerUrl, Issue.Id), "PUT", UpdateBody))
                        {
                            int ResponseCode = (int)Response.StatusCode;
                            if (!(ResponseCode >= 200 && ResponseCode <= 299))
                            {
                                throw new Exception("Unable to delete issue");
                            }
                        }

                        Issue.bPostedResolved = Issue.ResolvedAt.HasValue;
                        WriteState(StateFile, State);
                    }
                }

                // Update watchers on any open builds
                foreach (BuildHealthIssue Issue in State.Issues)
                {
                    while (Issue.PendingWatchers.Count > 0)
                    {
                        CommandTypes.Watcher Watcher = new CommandTypes.Watcher();
                        Watcher.UserName = Issue.PendingWatchers.First();

                        using (HttpWebResponse Response = SendHttpRequest(String.Format("{0}/api/issues/{1}/watchers", ServerUrl, Issue.Id), "POST", Watcher))
                        {
                            int ResponseCode = (int)Response.StatusCode;
                            if (!(ResponseCode >= 200 && ResponseCode <= 299))
                            {
                                throw new Exception("Unable to add watcher");
                            }
                        }

                        Issue.PendingWatchers.Remove(Watcher.UserName);
                        Issue.Watchers.Add(Watcher.UserName);

                        WriteState(StateFile, State);
                    }
                }
            }

            // Remove any issues which have been resolved for 24 hours. We have to keep information about issues that have been fixed for some time; we may be updating the same job
            // multiple times while other steps are running, and we don't want to keep opening new issues for it. Also, it can take time for changes to propagate between streams.
            DateTime RemoveIssueTime = DateTime.UtcNow - TimeSpan.FromHours(24.0);

            for (int Idx = 0; Idx < State.Issues.Count; Idx++)
            {
                BuildHealthIssue Issue = State.Issues[Idx];
                if (Issue.ResolvedAt.HasValue && Issue.ResolvedAt.Value < RemoveIssueTime)
                {
                    State.Issues.RemoveAt(Idx--);
                    WriteState(StateFile, State);
                    continue;
                }
            }

            // TODO: VERIFY ISSUES ARE CLOSED
        }
Esempio n. 43
0
 public void DeleteIssue(Issue issue)
 {
 }
Esempio n. 44
0
 public void SaveIssue(Issue issue)
 {
 }
        internal Comment GetIssueComment(Issue issue, int?commentId)
        {
            var overrideUrl = String.Format(_issuesIdUrl + "comments/{1}", issue.local_id, commentId);

            return(_sharpBucketV1.Get <Comment>(overrideUrl));
        }
Esempio n. 46
0
 public static void MapFromEditVm(this Issue issue, EditViewModel vm)
 {
     issue.Title            = vm.Title;
     issue.ShortDescription = vm.ShortDescription;
     issue.LongDescription  = vm.LongDescription;
 }
        internal List <Comment> ListIssueComments(Issue issue)
        {
            var overrideUrl = String.Format(_issuesIdUrl + "comments", issue.local_id);

            return(_sharpBucketV1.Get <List <Comment> >(overrideUrl));
        }
Esempio n. 48
0
        public async Task AssignTestItemIssuesTest()
        {
            var suite = await Service.TestItem.StartAsync(new StartTestItemRequest
            {
                LaunchUuid = _fixture.LaunchUuid,
                Name       = "Suite1",
                StartTime  = DateTime.UtcNow,
                Type       = TestItemType.Suite
            });

            var test1 = await Service.TestItem.StartAsync(suite.Uuid, new StartTestItemRequest
            {
                LaunchUuid = _fixture.LaunchUuid,
                Name       = "Test1",
                StartTime  = DateTime.UtcNow,
                Type       = TestItemType.Test
            });

            Assert.NotNull(test1.Uuid);

            var step1 = await Service.TestItem.StartAsync(test1.Uuid, new StartTestItemRequest
            {
                LaunchUuid = _fixture.LaunchUuid,
                Name       = "Step1",
                StartTime  = DateTime.UtcNow,
                Type       = TestItemType.Step
            });

            Assert.NotNull(step1.Uuid);

            var messageStep1 = await Service.TestItem.FinishAsync(step1.Uuid, new FinishTestItemRequest
            {
                EndTime = DateTime.UtcNow,
                Status  = Status.Failed,
                Issue   = new Issue
                {
                    Comment = "Comment 1",
                    Type    = "TI001"
                }
            });

            Assert.Contains("successfully", messageStep1.Info);

            var messageTest1 = await Service.TestItem.FinishAsync(test1.Uuid, new FinishTestItemRequest
            {
                EndTime = DateTime.UtcNow,
                Status  = Status.Passed
            });

            Assert.Contains("successfully", messageTest1.Info);

            var test2 = await Service.TestItem.StartAsync(suite.Uuid, new StartTestItemRequest
            {
                LaunchUuid = _fixture.LaunchUuid,
                Name       = "Test1",
                StartTime  = DateTime.UtcNow,
                Type       = TestItemType.Test
            });

            Assert.NotNull(test2.Uuid);

            var step2 = await Service.TestItem.StartAsync(test2.Uuid, new StartTestItemRequest
            {
                LaunchUuid = _fixture.LaunchUuid,
                Name       = "Step1",
                StartTime  = DateTime.UtcNow,
                Type       = TestItemType.Step
            });

            Assert.NotNull(step2.Uuid);

            var messageStep2 = await Service.TestItem.FinishAsync(step2.Uuid, new FinishTestItemRequest
            {
                EndTime = DateTime.UtcNow,
                Status  = Status.Failed,
                Issue   = new Issue
                {
                    Comment = "Comment 2",
                    Type    = "ab001"
                }
            });

            Assert.Contains("successfully", messageStep2.Info);

            var messageTest2 = await Service.TestItem.FinishAsync(test2.Uuid, new FinishTestItemRequest
            {
                EndTime = DateTime.UtcNow,
                Status  = Status.Passed
            });

            Assert.Contains("successfully", messageTest2.Info);

            var messageSuite = await Service.TestItem.FinishAsync(suite.Uuid, new FinishTestItemRequest
            {
                EndTime = DateTime.UtcNow,
                Status  = Status.Passed
            });

            Assert.Contains("successfully", messageSuite.Info);

            var issue1 = new Issue
            {
                Comment = "New Comment 1",
                Type    = "pb001"
            };

            var issue2 = new Issue
            {
                Comment = "New Comment 2",
                Type    = "si001",
                //ExternalSystemIssues = new List<ExternalSystemIssue>
                //{
                //    new ExternalSystemIssue { TicketId = "XXXXX-15", Url = "https://jira.epam.com/jira/browse/XXXXX-15" }
                //}
            };

            var tempStep1 = await Service.TestItem.GetAsync(step1.Uuid);

            var tempStep2 = await Service.TestItem.GetAsync(step2.Uuid);

            var assignedIssues = await Service.TestItem.AssignIssuesAsync(new AssignTestItemIssuesRequest
            {
                Issues = new List <TestItemIssueUpdate>
                {
                    new TestItemIssueUpdate
                    {
                        Issue      = issue1,
                        TestItemId = tempStep1.Id
                    },
                    new TestItemIssueUpdate
                    {
                        Issue      = issue2,
                        TestItemId = tempStep2.Id
                    }
                }
            });

            Assert.Equal(2, assignedIssues.Count());

            Assert.Equal(issue1.Comment, assignedIssues.First().Comment);
            Assert.Equal(issue1.Type, assignedIssues.First().Type);
            //Assert.Null(assignedIssues.First().ExternalSystemIssues);

            Assert.Equal(issue2.Comment, assignedIssues.ElementAt(1).Comment);
            Assert.Equal(issue2.Type, assignedIssues.ElementAt(1).Type);
            Assert.NotNull(assignedIssues.ElementAt(1).ExternalSystemIssues);

            //Assert.Single(assignedIssues.ElementAt(1).ExternalSystemIssues);
            //Assert.True(assignedIssues.ElementAt(1).ExternalSystemIssues.First().SubmitDate - DateTime.UtcNow < TimeSpan.FromMinutes(1));
            //Assert.Equal(Username, assignedIssues.ElementAt(1).ExternalSystemIssues.First().Submitter);
            //Assert.Equal(issue2.ExternalSystemIssues.First().TicketId, assignedIssues.ElementAt(1).ExternalSystemIssues.First().TicketId);
            //Assert.Equal(issue2.ExternalSystemIssues.First().Url, assignedIssues.ElementAt(1).ExternalSystemIssues.First().Url);

            var stepInfo1 = await Service.TestItem.GetAsync(step1.Uuid);

            Assert.NotNull(stepInfo1.Issue);

            var stepInfo2 = await Service.TestItem.GetAsync(step2.Uuid);

            Assert.NotNull(stepInfo2.Issue);

            Assert.Equal(issue1.Comment, stepInfo1.Issue.Comment);
            Assert.Equal(issue1.Type, stepInfo1.Issue.Type);
            //Assert.Null(stepInfo1.Issue.ExternalSystemIssues);

            Assert.Equal(issue2.Comment, stepInfo2.Issue.Comment);
            Assert.Equal(issue2.Type, stepInfo2.Issue.Type);
            //Assert.NotNull(stepInfo2.Issue.ExternalSystemIssues);

            //Assert.Single(stepInfo2.Issue.ExternalSystemIssues);
            //Assert.True(stepInfo2.Issue.ExternalSystemIssues.First().SubmitDate - DateTime.UtcNow < TimeSpan.FromMinutes(1));
            //Assert.Equal(Username, stepInfo2.Issue.ExternalSystemIssues.First().Submitter);
            //Assert.Equal(issue2.ExternalSystemIssues.First().TicketId, stepInfo2.Issue.ExternalSystemIssues.First().TicketId);
            //Assert.Equal(issue2.ExternalSystemIssues.First().Url, stepInfo2.Issue.ExternalSystemIssues.First().Url);
        }
        internal Issue PutIssue(Issue issue)
        {
            var overrideUrl = String.Format(_issuesIdUrl, issue.local_id);

            return(_sharpBucketV1.Put(issue, overrideUrl));
        }
Esempio n. 50
0
 protected override void ProcessClose()
 {
     Issue.SetState(Issue.CloseState);
 }
        internal IssueFollowers ListIssueFollowers(Issue issue)
        {
            var overrideUrl = String.Format(_issuesIdUrl + "followers", issue.local_id);

            return(_sharpBucketV1.Get <IssueFollowers>(overrideUrl));
        }
Esempio n. 52
0
 public DoneState(Issue issue) : base(issue)
 {
 }
Esempio n. 53
0
 public Task <Issue> AddIssueAsync(Issue Issue,
                                   CancellationToken cancellationToken = default(CancellationToken))
 {
     throw new NotSupportedException();
 }
 internal Comment DeleteIssueComment(Issue issue, int?commentId)
 {
     return(DeleteIssueComment(issue, new Comment {
         comment_id = commentId
     }));
 }
Esempio n. 55
0
 public Task <Issue> UpdateIssueAsync(Issue issue)
 {
     throw new NotSupportedException();
 }
        internal Comment DeleteIssueComment(Issue issue, Comment comment)
        {
            var overrideUrl = String.Format(_issuesIdUrl + "comments/{1}", issue.local_id, comment.comment_id);

            return(_sharpBucketV1.Delete <Comment>(overrideUrl));
        }
Esempio n. 57
0
        private List <WorkItem> ReadWorkItems(Issue issue)
        {
            List <WorkItem> ret = new List <WorkItem>();

            string businessOwner = "n/a";

            try {
                foreach (CustomField field in issue.CustomFields)
                {
                    if (field.Id.ToLower() == Properties.Settings.Default.BusinessOwnerTag)   // 14602
                    // Business Owner
                    {
                        businessOwner = field.Values[0];
                        break;
                    }
                }
            } catch {
                businessOwner = "n/a";
            }

            string[] costCentres = new string[0];
            try {
                costCentres = issue.CustomFields["Cost Centre"].Values;
            } catch {
                // leave empty
            }
            string creditTrading = IsCostCentre(costCentres, "Credit Trading") ? "Y" : "";
            string londonTrading = IsCostCentre(costCentres, "London Trading") ? "Y" : "";
            string stockLoan     = IsCostCentre(costCentres, "Stock Loan") ? "Y" : "";

            foreach (Worklog work in issue.GetWorklogs())
            {
                string worker = work.Author;
                double hours  = work.TimeSpentInSeconds;

                WorkItem item = new WorkItem();
                item.ID            = int.Parse(work.Id);
                item.BusinessOwner = businessOwner;
                item.CreditTrading = creditTrading;
                item.Employee      = work.Author;
                item.Hours         = work.TimeSpentInSeconds / 3600.0;
                item.Issue         = issue.Key.ToString();
                item.IssueSummary  = issue.Summary;
                item.LondonTrading = londonTrading;
                item.StockLoan     = stockLoan;
                if (work.StartDate == null)
                {
                    item.WorkDate = "n/a";
                }
                else
                {
                    item.WorkDate = ((DateTime)work.StartDate).ToString("dd MMM yyyy");
                }
                item.WorkDescription = work.Comment.Replace("\n", "").Replace("\r", "");
                if (issue.Updated == null)
                {
                    item.UpdateTime = DateTime.Parse("1 Jan 2000");
                }
                else
                {
                    item.UpdateTime = (DateTime)issue.Updated;
                }

                ret.Add(item);
            }

            return(ret);
        }
        internal Comment PostIssueComment(Issue issue, Comment comment)
        {
            var overrideUrl = String.Format(_issuesIdUrl + "comments", issue.local_id);

            return(_sharpBucketV1.Post(comment, overrideUrl));
        }
Esempio n. 59
0
        /// <summary>
        /// Page Load Event
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                var s = GetLocalResourceObject("DeleteIssueQuestion").ToString().Trim().JsEncode();
                lnkDelete.Attributes.Add("onclick", string.Format("return confirm('{0}');", s));

                IssueId = Request.QueryString.Get("id", 0);

                // If don't know issue id then redirect to something missing page
                if (IssueId == 0)
                {
                    ErrorRedirector.TransferToSomethingMissingPage(Page);
                }

                //set up global properties
                _currentIssue = IssueManager.GetById(IssueId);

                if (_currentIssue == null || _currentIssue.Disabled)
                {
                    ErrorRedirector.TransferToNotFoundPage(Page);
                    return;
                }

                //private issue check
                var issueVisible = IssueManager.CanViewIssue(_currentIssue, Security.GetUserName());

                //private issue check
                if (!issueVisible)
                {
                    ErrorRedirector.TransferToLoginPage(Page);
                }

                _currentProject = ProjectManager.GetById(_currentIssue.ProjectId);

                if (_currentProject == null)
                {
                    ErrorRedirector.TransferToNotFoundPage(Page);
                    return;
                }

                ProjectId = _currentProject.Id;

                if (_currentProject.AccessType == ProjectAccessType.Private && !User.Identity.IsAuthenticated)
                {
                    ErrorRedirector.TransferToLoginPage(Page);
                }
                else if (User.Identity.IsAuthenticated && _currentProject.AccessType == ProjectAccessType.Private &&
                         !ProjectManager.IsUserProjectMember(User.Identity.Name, ProjectId))
                {
                    ErrorRedirector.TransferToLoginPage(Page);
                }

                BindValues(_currentIssue);

                // Page.Title = string.Concat(_currentIssue.FullId, ": ", Server.HtmlDecode(_currentIssue.Title));
                lblIssueNumber.Text  = string.Format("{0}-{1}", _currentProject.Code, IssueId);
                ctlIssueTabs.Visible = true;

                SetFieldSecurity();

                if (!_currentProject.AllowIssueVoting)
                {
                    VoteBox.Visible = false;
                }

                //set the referrer url
                if (Request.UrlReferrer != null)
                {
                    if (Request.UrlReferrer.ToString() != Request.Url.ToString())
                    {
                        Session["ReferrerUrl"] = Request.UrlReferrer.ToString();
                    }
                }
                else
                {
                    Session["ReferrerUrl"] = string.Format("~/Issues/IssueList.aspx?pid={0}", ProjectId);
                }
            }

            Page.Title = string.Concat(lblIssueNumber.Text, ": ", Server.HtmlDecode(TitleTextBox.Text));

            //need to rebind these on every postback because of dynamic controls
            ctlCustomFields.DataSource = CustomFieldManager.GetByIssueId(IssueId);
            ctlCustomFields.DataBind();

            // The ExpandIssuePaths method is called to handle
            // the SiteMapResolve event.
            SiteMap.SiteMapResolve += ExpandIssuePaths;

            ctlIssueTabs.IssueId   = IssueId;
            ctlIssueTabs.ProjectId = ProjectId;
        }
Esempio n. 60
0
        /// <summary>
        /// Binds the values.
        /// </summary>
        private void BindValues(Issue currentIssue)
        {
            BindOptions();

            lblIssueNumber.Text = string.Concat(currentIssue.FullId, ":");
            TitleLabel.Text     = Server.HtmlDecode(currentIssue.Title);

            DropIssueType.SelectedValue  = currentIssue.IssueTypeId;
            DropResolution.SelectedValue = currentIssue.ResolutionId;
            DropStatus.SelectedValue     = currentIssue.StatusId;
            DropPriority.SelectedValue   = currentIssue.PriorityId;
            DropOwned.SelectedValue      = currentIssue.OwnerUserName;


            // SMOSS: XSS Bugfix
            Description.Text = (currentIssue.Description);

            // WARNING: Do Not html decode the text for the editor.
            // The editor is expecting HtmlEncoded text as input.
            DescriptionHtmlEditor.Text = currentIssue.Description;
            lblLastUpdateUser.Text     = currentIssue.LastUpdateDisplayName;
            lblReporter.Text           = currentIssue.CreatorDisplayName;

            // XSS Bugfix
            // The text box is expecting raw html
            TitleTextBox.Text                   = Server.HtmlDecode(currentIssue.Title);
            DisplayTitleLabel.Text              = currentIssue.Title;
            lblDateCreated.Text                 = currentIssue.DateCreated.ToString("g");
            lblLastModified.Text                = currentIssue.LastUpdate.ToString("g");
            lblIssueNumber.Text                 = currentIssue.FullId;
            DropCategory.SelectedValue          = currentIssue.CategoryId;
            DropMilestone.SelectedValue         = currentIssue.MilestoneId;
            DropAffectedMilestone.SelectedValue = currentIssue.AffectedMilestoneId;
            DropAssignedTo.SelectedValue        = currentIssue.AssignedUserName;
            lblLoggedTime.Text                  = currentIssue.TimeLogged.ToString();
            txtEstimation.Text                  = currentIssue.Estimation == 0 ? string.Empty : currentIssue.Estimation.ToString();
            DueDatePicker.SelectedValue         = currentIssue.DueDate == DateTime.MinValue ? null : (DateTime?)currentIssue.DueDate;
            chkPrivate.Checked                  = currentIssue.Visibility != 0;
            ProgressSlider.Text                 = currentIssue.Progress.ToString();
            IssueVoteCount.Text                 = currentIssue.Votes.ToString();

            if (User.Identity.IsAuthenticated && IssueVoteManager.HasUserVoted(currentIssue.Id, Security.GetUserName()))
            {
                VoteButton.Visible = false;
                VotedLabel.Visible = true;
                VotedLabel.Text    = GetLocalResourceObject("Voted").ToString();
            }
            else
            {
                VoteButton.Visible = true;
                VotedLabel.Visible = false;
            }

            if (currentIssue.StatusId != 0 && StatusManager.GetById(currentIssue.StatusId).IsClosedState)
            {
                VoteButton.Visible = false;
                VotedLabel.Visible = false;
            }

            List <DefaultValue> defValues     = IssueManager.GetDefaultIssueTypeByProjectId(ProjectId);
            DefaultValue        selectedValue = defValues.FirstOrDefault();

            if (selectedValue != null)
            {
                // Visibility Section
                IssueTypeField.Visible         = selectedValue.TypeEditVisibility;
                StatusField.Visible            = selectedValue.StatusEditVisibility;
                PriorityField.Visible          = selectedValue.PriorityEditVisibility;
                PrivateField.Visible           = selectedValue.PrivateEditVisibility;
                CategoryField.Visible          = selectedValue.CategoryEditVisibility;
                DueDateField.Visible           = selectedValue.DueDateEditVisibility;
                ProgressField.Visible          = selectedValue.PercentCompleteEditVisibility;
                MilestoneField.Visible         = selectedValue.MilestoneEditVisibility;
                EstimationField.Visible        = selectedValue.EstimationEditVisibility;
                ResolutionField.Visible        = selectedValue.ResolutionEditVisibility;
                AffectedMilestoneField.Visible = selectedValue.AffectedMilestoneEditVisibility;
                AssignedToField.Visible        = selectedValue.AssignedToEditVisibility;
                OwnedByField.Visible           = selectedValue.OwnedByEditVisibility;
            }
        }