コード例 #1
0
        public List <JiraField> getFieldsForAction(JiraIssue issue, int id)
        {
#if PLVS_133_WORKAROUND
            object[] fields = service.getFieldsForAction(Token, issue.Key, id.ToString());
            if (fields == null)
            {
                return(new List <JiraField>());
            }

            return((from field in fields
                    where field != null
                    let fieldId = field.GetType().GetProperty("id")
                                  let name = field.GetType().GetProperty("name")
                                             select new JiraField((string)fieldId.GetValue(field, null), (string)name.GetValue(field, null)))
                   .ToList());
#else
            RemoteField[] fields = service.getFieldsForAction(Token, issue.Key, id.ToString());
            if (fields == null)
            {
                return(new List <JiraField>());
            }

            return((from field in fields
                    where field != null
                    select new JiraField(field.id, field.name)).ToList());
#endif
        }
コード例 #2
0
        public List <JiraField> getFieldsForAction(JiraIssue issue, int id)
        {
            RemoteField[]    fields = service.getFieldsForAction(token, issue.Key, id.ToString());
            List <JiraField> list   = new List <JiraField>();

            foreach (RemoteField field in fields)
            {
                list.Add(new JiraField(field.id, field.name));
            }
            return(list);
        }
コード例 #3
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());
        }