public ActionResult History(int id = 1) { var historyEntries = history.GetHistoryEntriesByIssueKey(id); if (historyEntries != null && historyEntries.Count > 0) { var currentIssue = issue.GetIssueById(id); if (currentIssue != null) { var issueTitle = issue.GetIssueById(id).IssueTitle; ViewBag.IssueTitle = issueTitle; } foreach (History h in historyEntries) { var edited = admin.GetUserNameById(h.EditedBy); var ih = new HistoryViewModel(); ih.History = h; ih.EditedBy = edited; issueHistories.Add(ih); } ViewBag.Title = String.Empty; return(View(issueHistories)); } ViewBag.Title = "No history to display"; return(View()); }