public JiraIssue[] getIssuesForFilter(string filterId) { List <JiraIssue> issuesToReturn = new List <JiraIssue>(); checkCredentials(); try { RemoteIssue[] issues = jira.getIssuesFromFilter(credentials, filterId); foreach (RemoteIssue issue in issues) { try { JiraIssue jiraIssue = new JiraIssue(issue.key, issue.created, getUserFullName(issue.reporter), getUserFullName(issue.assignee), issue.project, issue.summary, issue.description, "", issue.attachmentNames); issuesToReturn.Add(jiraIssue); } catch (Exception e) { LOG.Error("Problem retrieving Jira: " + issue.key, e); JiraIssue jiraIssue = createDummyErrorIssue(e); jiraIssue.Key = issue.key; issuesToReturn.Add(jiraIssue); } } } catch (Exception e) { LOG.Error("Problem retrieving Jiras for Filter: " + filterId, e); issuesToReturn.Add(createDummyErrorIssue(e)); } return(issuesToReturn.ToArray());; }
public JiraIssue[] getIssuesForFilter(string filterId) { List <JiraIssue> issuesToReturn = new List <JiraIssue>(); checkCredentials(); try { RemoteIssue[] issues = jira.getIssuesFromFilter(credentials, filterId); #region Username cache update List <string> users = new List <string>(); foreach (RemoteIssue issue in issues) { if (issue.reporter != null && !hasUser(issue.reporter) && !users.Contains(issue.reporter)) { users.Add(issue.reporter); } if (issue.assignee != null && !hasUser(issue.assignee) && !users.Contains(issue.assignee)) { users.Add(issue.assignee); } } int taskCount = users.Count; if (taskCount > 0) { ManualResetEvent doneEvent = new ManualResetEvent(false); for (int i = 0; i < users.Count; i++) { ThreadPool.QueueUserWorkItem(delegate(object name) { LOG.InfoFormat("Retrieving {0}", name); getUserFullName((string)name); if (Interlocked.Decrement(ref taskCount) == 0) { doneEvent.Set(); } }, users[i]); } doneEvent.WaitOne(); } #endregion foreach (RemoteIssue issue in issues) { try { JiraIssue jiraIssue = new JiraIssue(issue.key, issue.created, getUserFullName(issue.reporter), getUserFullName(issue.assignee), issue.project, issue.summary, issue.description, "", issue.attachmentNames); issuesToReturn.Add(jiraIssue); } catch (Exception e) { LOG.Error("Problem retrieving Jira: " + issue.key, e); JiraIssue jiraIssue = createDummyErrorIssue(e); jiraIssue.Key = issue.key; issuesToReturn.Add(jiraIssue); } } } catch (Exception e) { LOG.Error("Problem retrieving Jiras for Filter: " + filterId, e); issuesToReturn.Add(createDummyErrorIssue(e)); } return(issuesToReturn.ToArray());; }
internal IIssue[] GetIssuesByFilter(JiraFilter filter) { List <JiraIssue> issues = new List <JiraIssue>(); foreach (RemoteIssue issue in _service.getIssuesFromFilter(_token, filter.Id)) { issues.Add(new JiraIssue(this, issue)); } return(issues.ToArray()); }
public XDoc Table( [DekiExtParam("filter name")] string filter ) { InitializeService(); InitializeStatuses(); InitializeFilters(); InitializePriorities(); RemoteFilter f = RetrieveFilter(filter); RemoteIssue[] issues = _jira.getIssuesFromFilter(_jiraToken, f.id); XDoc bugList = BuildBugListHTMLTable(issues); XDoc ret = new XDoc("html"); ret.Start("head") .Start("script").Attr("type", "text/javascript").Attr("src", Files.At("sorttable.js")).End() .Start("link").Attr("type", "text/css").Attr("rel", "stylesheet").Attr("href", Files.At("Jira.css")).End() .Start("style").Attr("type", "text/css").Value(@".feedtable { border:1px solid #999; line-height:1.5em; overflow:hidden; width:100%; } .feedtable th { background-color:#ddd; border-bottom:1px solid #999; font-size:14px; } .feedtable tr { background-color:#FFFFFF; } .feedtable tr.feedroweven td { background-color:#ededed; }").End() .End(); ret.Start("body").Add(bugList).End(); return(ret); }