public IEnumerable <Issue> GetJiraIssuesFromFilter(string filterName) { try { CheckAndConnectJira(); var issues = jira.GetIssuesFromFilter(filterName); recentJiraCollection.AddRecentJiras(issues); return(issues.OrderBy(x => x.key, new JiraReferenceComparer())); } catch (Exception ex) { throw new NoResultsFoundException("Error loading jiras from filter", ex); } }
public IEnumerable <Issue> GetJiraIssuesFromFilter(string filterName) { try { CheckAndConnectJira(); trackUsage.TrackAppUsage(TrackingType.SearchFilter); var filterJql = jira.GetJqlForFilter(filterName); var issues = jira.GetIssuesFromFilter(filterName).ToList(); recentJiraCollection.AddRecentJiras(issues); if (filterJql.ToLower().Contains("order by")) { return(issues); } return(issues.OrderBy(x => x.key, new JiraReferenceComparer())); } catch (Exception ex) { throw new NoResultsFoundException("Error loading jiras from filter", ex); } }
public bool DoesJiraExist(string jiraRef) { try { CheckAndConnectJira(); var issues = jira.GetIssuesFromJql($"key = \"{jiraRef}\"").ToList(); if (issues.Any()) { recentJiraCollection.AddRecentJiras(issues); return(true); } else { recentJiraCollection.Remove(jiraRef); return(false); } } catch (Exception) { recentJiraCollection.Remove(jiraRef); return(false); } }