private void LoadIssuesToShow()
        {
            issueList =
                controller.GetOpenIssuesFromProject(JiraConfigurationHelper.getCurrentProjectKey());

            grdIssues.DataSource = issueList;

            grdIssues.AutoGenerateColumns = true;

            grdIssues.Columns.Insert(0, new DataGridViewCheckBoxColumn());

            // Don't allow the column to be resizable.
            grdIssues.Columns[0].Resizable = DataGridViewTriState.False;

            // Make the check box column frozen so it is always visible.
            grdIssues.Columns[0].Frozen = true;

            // Put an extra border to make the frozen column more visible
            grdIssues.Columns[0].DividerWidth = 1;

            // Auto size columns after the grid data binding is complete.
            grdIssues.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells);

            foreach (DataGridViewRow row in grdIssues.Rows)
            {
                row.Tag = issueList[row.Index];
            }
        }
示例#2
0
        /// <summary>
        /// This method builds a HTTP URL to perform a request to JIRA in order to get certain issues applying a filter
        /// </summary>
        /// <param name="projectId">The id of the project</param>
        /// <param name="asignee">The asignee whose issues we are filtering</param>
        /// <param name="status">The status of the issues we are filtering</param>
        /// <returns>A string with a well formed URL to perform a XML-HTTP request</returns>
        public static string GetJiraRpcUrlForFilter(string projectId, JiraIssueAsignee asignee, JiraIssueStatus status)
        {
            StringBuilder url = new StringBuilder();

            url.Append(GetJiraBaseURL());
            url.Append("/secure/IssueNavigator.jspa?");
            url.Append("view=rss");
            url.Append("&pid=" + projectId);
            if (asignee == JiraIssueAsignee.CURRENT_USER)
            {
                url.Append("&assigneeSelect=issue_current_user");
            }
            if (status == JiraIssueStatus.OPEN)
            {
                url.Append("&status=1");
            }
            if (status == JiraIssueStatus.UNRESOLVED)
            {
                url.Append("&resolution=-1");
            }
            url.Append("&sorter/field=issuekey&sorter/order=DESC");
            url.Append("&reset=true&decorator=none&");
            url.Append("os_username="******"&os_password=" + JiraConfigurationHelper.GetUserPassword());

            return(url.ToString());
        }
示例#3
0
 /// <summary>
 /// Adds a comment to an Issue
 /// </summary>
 /// <param name="issue">The <c>Issue</c> entity to which the comment will be added</param>
 /// <param name="comment">The text of the comment to be added</param>
 public void AddCommentToIssue(Issue issue, string comment)
 {
     try {
         IssueComment issueComment = new IssueComment(JiraConfigurationHelper.GetUserName(), DateTime.Now, comment);
         this.Provider.AddCommentToIssue(issue.Key, issueComment);
     }
     catch (Exception ex) {
         ExceptionManager.PublishException(ex);
     }
 }
 private void HandleException(Exception ex)
 {
     if (ex is FunctionalException)
     {
         DisplayErrorMessage(ex.Message, "Functional Error");
     }
     else
     {
         LogManager.WriteMessage(ex.Message + "\n" + ex.StackTrace);
         DisplayErrorMessage(JiraConfigurationHelper.GetTechnicalErrorMessage(), "Technical Error");
     }
 }
示例#5
0
        /// <summary>
        /// Gets a formatted URL prepared specially to perform an HTTP Request
        /// that logs work done to an issue
        /// </summary>
        /// <param name="issueId">The ID of the selected issue to log work to</param>
        /// <param name="workDone">A string representing the ammount of work done as entered by the user</param>
        /// <returns>The formatted URL string</returns>
        public static string GetJiraRpcUrlForLoggingWorkDone(string issueId, string workDone, string workDescription)
        {
            StringBuilder url = new StringBuilder();

            url.Append(GetJiraBaseURL());
            url.Append("/secure/LogWork.jspa?");
            url.Append("id=" + issueId);
            url.Append("&timeLogged=" + workDone);
            url.Append("&comment=" + workDescription);
            url.Append("&os_username="******"&os_password=" + JiraConfigurationHelper.GetUserPassword());
            return(url.ToString());
        }
        internal void RefreshIssuesToShow()
        {
            //Get the unresolved issues cache from the controller
            issueList =
                controller.GetOpenIssuesFromProject(JiraConfigurationHelper.getCurrentProjectKey());
            //rebind the list
            this.grdIssues.DataSource = issueList;

            //save the tag object for each row
            foreach (DataGridViewRow row in grdIssues.Rows)
            {
                row.Tag = issueList[row.Index];
            }

            //redraw the grid
            this.grdIssues.Invalidate();
        }
示例#7
0
 public static JiraSoapServiceService GetJiraSoapServiceProxy()
 {
     return(GetWSProxy(JiraConfigurationHelper.GetJiraURL(), JiraConfigurationHelper.getJiraPort()));
 }
示例#8
0
        public static string GetJiraBaseURL()
        {
            string url = JiraConfigurationHelper.GetJiraURL() + ":" + JiraConfigurationHelper.getJiraPort();

            return(url);
        }
 private void RefreshIssues()
 {
     this.InvalidateUnresolvedIssuesCache();
     this.unresolvedIssuesCache = GetOpenIssuesFromProject(JiraConfigurationHelper.getCurrentProjectKey());
     MainToolbar.RefreshIssuesToShow();
 }
        /// <summary>
        /// Gets a list of Version ID's according to those Versions Names
        /// </summary>
        /// <param name="versionNames">The list containing the versions names whose IDs we want to get</param>
        /// <returns>A list containing the IDs of the appropiate versions</returns>
        public List <string> GetVersionsIdsFromVersionNames(string[] versionNames)
        {
            List <string> versionIDs = new List <string>();

            RemoteVersion[] projectVersions =
                JiraSoapHelper.GetJiraSoapServiceProxy().getVersions(AuthenticationToken, JiraConfigurationHelper.getCurrentProjectKey());

            foreach (string name in versionNames)
            {
                foreach (RemoteVersion projectVersion in projectVersions)
                {
                    if (projectVersion.name.Equals(name))
                    {
                        versionIDs.Add(projectVersion.id);
                        break;
                    }
                }
            }
            return(versionIDs);
        }