コード例 #1
0
ファイル: Submission.cs プロジェクト: mo5h/omeo
        /// <summary>
        /// A helper for creating the remote field value.
        /// </summary>
        public static RemoteFieldValue CreateFieldValue(string id, params string[] values)
        {
            RemoteFieldValue retval = new RemoteFieldValue();

            retval.id     = id;
            retval.values = values;
            return(retval);
        }
コード例 #2
0
ファイル: Submission.cs プロジェクト: mo5h/omeo
        /// <summary>
        /// A helper for creating the remote field value.
        /// </summary>
        public static RemoteFieldValue CreateFieldValue(JiraIssueType.JiraIssueKeys id, params string[] values)
        {
            RemoteFieldValue retval = new RemoteFieldValue();

            retval.id     = id.ToString();
            retval.values = values;
            return(retval);
        }
コード例 #3
0
        /// <summary>
        /// Stops the work progress of an Issue
        /// </summary>
        /// <param name="issueKey">The key of the issue whose progress is being stopped</param>
        public void StopIssueProgress(string issueKey)
        {
            string actionId = ((int)JiraWorkflowAction.STOP_PROGRESS).ToString();

            // No special parameters for this action
            RemoteFieldValue[] actionParams = new RemoteFieldValue[0];
            JiraSoapHelper.GetJiraSoapServiceProxy().progressWorkflowAction(AuthenticationToken, issueKey, actionId, actionParams);
        }
コード例 #4
0
        public void AddLabels(string token, RemoteIssue remoteIssue, string[] labels)
        {
            var fields = new RemoteFieldValue[] {
                new RemoteFieldValue()
                {
                    id     = "labels",
                    values = labels
                }
            };

            this.UpdateIssue(token, remoteIssue, fields);
        }
コード例 #5
0
 public void ProgressWorkflow(string issueKey, string action, string assignee)
 {
     if (assignee != null)
     {
         var assigneeField = new RemoteFieldValue {
             id = "assignee", values = new[] { assignee }
         };
         soapService.progressWorkflowAction(loginToken, issueKey, action, new[] { assigneeField });
     }
     else
     {
         soapService.progressWorkflowAction(loginToken, issueKey, action, new RemoteFieldValue[] { });
     }
 }
コード例 #6
0
 public Issue UpdateIssue(string issueKey, string fieldName, string fieldValue)
 {
     try
     {
         var remoteFieldValue = new RemoteFieldValue {
             id = fieldName, values = new[] { fieldValue }
         };
         return(CreateIssue(soapService.updateIssue(loginToken, issueKey, new[] { remoteFieldValue })));
     }
     catch (SoapException ex)
     {
         ProcessException(ex);
         throw;
     }
 }
コード例 #7
0
        /// <summary>
        /// Progress the workflow of and Issue in order to resolve it or close it
        /// </summary>
        /// <param name="actionId">The string representation of the numeric id corresponding to the workflow action to perform</param>
        /// <param name="issueKey">The key of the Issue to resolve</param>
        /// <param name="resolutionKey">The resolution key of the issue</param>
        /// <param name="resolutionComment">An optional comment related to the action</param>
        /// <param name="fixVersions">A list a list containing all the Issue fix versions' ID's</param>
        /// <param name="affectsVersions">A list a list containing all the Issue affects versions' ID's</param>
        public void ProgressWorkflowForResolution(string actionId, string issueKey, string resolutionKey, string resolutionComment, string[] fixVersions, string[] affectsVersions)
        {
            RemoteCustomFieldValue[] customFields = this.GetIssueCustomFields(issueKey);

            List <RemoteFieldValue> actionParams = new List <RemoteFieldValue>();

            RemoteFieldValue asigneeParam = new RemoteFieldValue();

            asigneeParam.id     = "assignee";
            asigneeParam.values = new string[] { "-1" }; //Automatic
            actionParams.Add(asigneeParam);

            RemoteFieldValue resolutionParam = new RemoteFieldValue();

            resolutionParam.id     = "resolution";
            resolutionParam.values = new string[] { resolutionKey };
            actionParams.Add(resolutionParam);

            RemoteFieldValue fixVersionsParam = new RemoteFieldValue();

            fixVersionsParam.id     = "fixVersions";
            fixVersionsParam.values = fixVersions;
            actionParams.Add(fixVersionsParam);

            RemoteFieldValue affectsVersionsParam = new RemoteFieldValue();

            affectsVersionsParam.id     = "affectsVersions";
            affectsVersionsParam.values = affectsVersions;
            actionParams.Add(affectsVersionsParam);

            foreach (RemoteCustomFieldValue customField in customFields)
            {
                RemoteFieldValue customFieldParam = new RemoteFieldValue();
                customFieldParam.id = customField.customfieldId;
                //Nasty workaround for the fact that the SOAP API returns the same id for both items in a Cascading Select Custom Field
                foreach (RemoteFieldValue ap in actionParams)
                {
                    if (ap.id.Equals(customFieldParam.id))
                    {
                        customFieldParam.id += ":1";
                    }
                }
                customFieldParam.values = customField.values;
                actionParams.Add(customFieldParam);
            }

            JiraSoapHelper.GetJiraSoapServiceProxy().progressWorkflowAction(AuthenticationToken, issueKey, actionId, actionParams.ToArray());
        }
コード例 #8
0
        Task <RemoteFieldValue[]> IRemoteIssueFieldProvider.GetRemoteFieldValuesAsync(CancellationToken token)
        {
            var fields = new List <RemoteFieldValue>();

            if (_originalList.Count() != Items.Count() || _originalList.Except(Items).Any())
            {
                var field = new RemoteFieldValue()
                {
                    id     = _fieldName,
                    values = Items.Select(e => e.Id).ToArray()
                };
                fields.Add(field);
            }

            return(Task.FromResult(fields.ToArray()));
        }
コード例 #9
0
        RemoteFieldValue[] IRemoteIssueFieldProvider.GetRemoteFields()
        {
            var fields = new List <RemoteFieldValue>();

            if (_newElements.Count > 0)
            {
                var field = new RemoteFieldValue()
                {
                    id     = _fieldName,
                    values = _newElements.Select(e => e.Id).ToArray()
                };
                fields.Add(field);
            }

            return(fields.ToArray());
        }
コード例 #10
0
        internal void ProcessAction(JiraIssue issue, IIssueAction action, IIssueUser assignTo)
        {
            List <RemoteFieldValue> actionParams = new List <RemoteFieldValue>();

            RemoteField[] fields = _service.getFieldsForAction(_token, issue.DisplayId, action.Id);
            foreach (RemoteField field in fields)
            {
                RemoteFieldValue param     = new RemoteFieldValue();
                string           paramName = param.id = field.id;

                if (StringComparer.OrdinalIgnoreCase.Equals("Resolution", field.name))
                {
                    param.values = new string[] { FindFixResolution() }
                }
                ;
                else if (StringComparer.OrdinalIgnoreCase.Equals("Assignee", field.name))
                {
                    param.values = new string[] { assignTo.Id }
                }
                ;
                else if (StringComparer.OrdinalIgnoreCase.Equals("Worklog", paramName)) // JIRA 4.1 - worklogs are required!
                {
                    continue;
                }
                else
                {
                    param.values = issue.GetFieldValue(paramName);
                    if (param.values == null || param.values.Length == 0 || (param.values.Length == 1 && param.values[0] == null))
                    {
                        string setting = _settings(String.Format("{0}:{1}", action.Name, field.name));
                        if (setting != null)
                        {
                            param.values = new string[] { setting }
                        }
                        ;
                    }
                }

                actionParams.Add(param);
            }

            RemoteIssue newIssue = _service.progressWorkflowAction(_token, issue.DisplayId, action.Id, actionParams.ToArray());
        }
コード例 #11
0
 public RemoteIssue progressWorkflowAction(string in0, string in1, string in2, RemoteFieldValue[] in3) {
     object[] results = this.Invoke("progressWorkflowAction", new object[] {
                 in0,
                 in1,
                 in2,
                 in3});
     return ((RemoteIssue)(results[0]));
 }
コード例 #12
0
 /// <remarks/>
 public System.IAsyncResult BeginupdateIssue(string in0, string in1, RemoteFieldValue[] in2, System.AsyncCallback callback, object asyncState) {
     return this.BeginInvoke("updateIssue", new object[] {
                 in0,
                 in1,
                 in2}, callback, asyncState);
 }
コード例 #13
0
 /// <remarks/>
 public System.IAsyncResult BeginprogressWorkflowAction(string in0, string in1, string in2, RemoteFieldValue[] in3, System.AsyncCallback callback, object asyncState) {
     return this.BeginInvoke("progressWorkflowAction", new object[] {
                 in0,
                 in1,
                 in2,
                 in3}, callback, asyncState);
 }
コード例 #14
0
 /// <remarks/>
 public void updateIssueAsync(string in0, string in1, RemoteFieldValue[] in2, object userState) {
     if ((this.updateIssueOperationCompleted == null)) {
         this.updateIssueOperationCompleted = new System.Threading.SendOrPostCallback(this.OnupdateIssueOperationCompleted);
     }
     this.InvokeAsync("updateIssue", new object[] {
                 in0,
                 in1,
                 in2}, this.updateIssueOperationCompleted, userState);
 }
コード例 #15
0
 /// <remarks/>
 public void updateIssueAsync(string in0, string in1, RemoteFieldValue[] in2) {
     this.updateIssueAsync(in0, in1, in2, null);
 }
コード例 #16
0
 public RemoteIssue updateIssue(string in0, string in1, RemoteFieldValue[] in2) {
     object[] results = this.Invoke("updateIssue", new object[] {
                 in0,
                 in1,
                 in2});
     return ((RemoteIssue)(results[0]));
 }
コード例 #17
0
 /// <remarks/>
 public void progressWorkflowActionAsync(string in0, string in1, string in2, RemoteFieldValue[] in3, object userState) {
     if ((this.progressWorkflowActionOperationCompleted == null)) {
         this.progressWorkflowActionOperationCompleted = new System.Threading.SendOrPostCallback(this.OnprogressWorkflowActionOperationCompleted);
     }
     this.InvokeAsync("progressWorkflowAction", new object[] {
                 in0,
                 in1,
                 in2,
                 in3}, this.progressWorkflowActionOperationCompleted, userState);
 }
コード例 #18
0
 /// <remarks/>
 public void progressWorkflowActionAsync(string in0, string in1, string in2, RemoteFieldValue[] in3) {
     this.progressWorkflowActionAsync(in0, in1, in2, in3, null);
 }
コード例 #19
0
        /// <summary>
        /// Progress the workflow of and Issue in order to resolve it or close it
        /// </summary>
        /// <param name="actionId">The string representation of the numeric id corresponding to the workflow action to perform</param>
        /// <param name="issueKey">The key of the Issue to resolve</param>
        /// <param name="resolutionKey">The resolution key of the issue</param>
        /// <param name="resolutionComment">An optional comment related to the action</param>
        /// <param name="fixVersions">A list a list containing all the Issue fix versions' ID's</param>
        /// <param name="affectsVersions">A list a list containing all the Issue affects versions' ID's</param>
        public void ProgressWorkflowForResolution(string actionId, string issueKey, string resolutionKey, string resolutionComment, string[] fixVersions, string[] affectsVersions) {

            RemoteCustomFieldValue[] customFields =  this.GetIssueCustomFields(issueKey);

            List<RemoteFieldValue> actionParams = new List<RemoteFieldValue>();
            
            RemoteFieldValue asigneeParam = new RemoteFieldValue();
            asigneeParam.id = "assignee";
            asigneeParam.values = new string[] { "-1" }; //Automatic
            actionParams.Add(asigneeParam);

            RemoteFieldValue resolutionParam = new RemoteFieldValue();
            resolutionParam.id = "resolution";
            resolutionParam.values = new string[] { resolutionKey };
            actionParams.Add(resolutionParam);

            RemoteFieldValue fixVersionsParam = new RemoteFieldValue();
            fixVersionsParam.id = "fixVersions";
            fixVersionsParam.values = fixVersions;
            actionParams.Add(fixVersionsParam);

            RemoteFieldValue affectsVersionsParam = new RemoteFieldValue();
            affectsVersionsParam.id = "affectsVersions";
            affectsVersionsParam.values = affectsVersions;
            actionParams.Add(affectsVersionsParam);

            foreach (RemoteCustomFieldValue customField in customFields) {
                RemoteFieldValue customFieldParam = new RemoteFieldValue();
                customFieldParam.id = customField.customfieldId;
                //Nasty workaround for the fact that the SOAP API returns the same id for both items in a Cascading Select Custom Field
                foreach (RemoteFieldValue ap in actionParams){
                    if (ap.id.Equals(customFieldParam.id)) {
                        customFieldParam.id += ":1";
                    }
                }
                customFieldParam.values = customField.values;
                actionParams.Add(customFieldParam);
            }

            JiraSoapHelper.GetJiraSoapServiceProxy().progressWorkflowAction(AuthenticationToken, issueKey, actionId, actionParams.ToArray());
        }
コード例 #20
0
 /// <summary>
 /// Stops the work progress of an Issue
 /// </summary>
 /// <param name="issueKey">The key of the issue whose progress is being stopped</param>
 public void StopIssueProgress(string issueKey){
     string actionId = ((int)JiraWorkflowAction.STOP_PROGRESS).ToString();
     // No special parameters for this action
     RemoteFieldValue[] actionParams = new RemoteFieldValue[0];
     JiraSoapHelper.GetJiraSoapServiceProxy().progressWorkflowAction(AuthenticationToken, issueKey, actionId, actionParams);
 }