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 void runIssueActionWithoutParams(JiraIssue issue, int id) { service.progressWorkflowAction(Token, issue.Key, id.ToString(), null); }