/// <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); }
/// <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); }
/// <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); }
public void AddLabels(string token, RemoteIssue remoteIssue, string[] labels) { var fields = new RemoteFieldValue[] { new RemoteFieldValue() { id = "labels", values = labels } }; this.UpdateIssue(token, remoteIssue, fields); }
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[] { }); } }
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; } }
/// <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()); }
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())); }
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()); }
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()); }
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])); }
/// <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); }
/// <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); }
/// <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); }
/// <remarks/> public void updateIssueAsync(string in0, string in1, RemoteFieldValue[] in2) { this.updateIssueAsync(in0, in1, in2, null); }
public RemoteIssue updateIssue(string in0, string in1, RemoteFieldValue[] in2) { object[] results = this.Invoke("updateIssue", new object[] { in0, in1, in2}); return ((RemoteIssue)(results[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); }
/// <remarks/> public void progressWorkflowActionAsync(string in0, string in1, string in2, RemoteFieldValue[] in3) { this.progressWorkflowActionAsync(in0, in1, in2, in3, null); }
/// <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()); }
/// <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); }