public BugzillaBug(bug bug) : this() { bug_id = bug.bug_id; reporter = bug.reporter; assigned_to = bug.assigned_to; priority = bug.priority; bug_severity = bug.bug_severity; bug_status = bug.bug_status; op_sys = bug.op_sys; component = bug.component; version = bug.version; classification = bug.classification; rep_platform = bug.rep_platform; customFields = bug.custom_fieldCollection.Cast <custom_field>().ToList(); var longDescCollection = GetDescriptionCollection(bug); if (longDescCollection.Count > 0) { description = longDescCollection[0].thetext; } if (longDescCollection.Count > 1) { comments = longDescCollection .Cast <long_desc>() .Skip(1) .Select(x => new BugzillaComment(x)) .ToList(); } creation_ts = bug.creation_ts; short_desc = DescriptionConverter.CleanUpContent(bug.short_desc); attachmentCollection = CreateAttachments(bug.attachmentCollection.Cast <attachment>()); }
private static long_descCollection GetDescriptionCollection(bug bug) { foreach (long_desc description in bug.long_descCollection) { description.thetext = DescriptionConverter.CleanUpContent(description.thetext); } return(bug.long_descCollection); }
private int GetSeverity(bug myBug) { if (myBug.bug_severity.Text[0].Equals(Severities.enhancement)) return 6; else if (myBug.bug_severity.Text[0].Equals(Severities.trivial)) return 5; else if (myBug.bug_severity.Text[0].Equals(Severities.minor)) return 4; else if (myBug.bug_severity.Text[0].Equals(Severities.normal)) return 3; else if (myBug.bug_severity.Text[0].Equals(Severities.major)) return 2; else if (myBug.bug_severity.Text[0].Equals(Severities.critical)) return 1; else return 0; }
private string GetReporter(bug myBug) { return myBug.reporter.Text[0]; }