Beispiel #1
0
        public void runIssueActionWithParams(JiraIssue issue, JiraNamedEntity action, ICollection <JiraField> fields, string comment)
        {
            object data;
            var    fldsObj = new Dictionary <string, object>();

            foreach (var field in from field in fields
                     let ops = field.FieldDefinition["operations"]
                               where ops != null && ops.Values().Any(op => "set".Equals(op.Value <string>()))
                               select field)
            {
                fldsObj[field.Id] = field.getJsonValue();
            }
            if (comment != null)
            {
                var commentObj = new List <object> {
                    new { add = new { body = comment } }
                };
                data = new {
                    update     = new { comment = commentObj },
                    transition = new { id = action.Id },
                    fields     = fldsObj
                };
            }
            else
            {
                data = new {
                    transition = new { id = action.Id },
                    fields     = fldsObj
                };
            }

            postJson(BaseUrl + REST + "issue/" + issue.Key + "/transitions", data);
        }
 public void addResolution(JiraServer server, JiraNamedEntity resolution)
 {
     lock (resolutionCache) {
         if (!resolutionCache.ContainsKey(server.GUID))
         {
             resolutionCache[server.GUID] = new SortedDictionary <int, JiraNamedEntity>();
         }
         resolutionCache[server.GUID][resolution.Id] = resolution;
     }
 }
 public void addStatus(JiraServer server, JiraNamedEntity status)
 {
     lock (statusCache) {
         if (!statusCache.ContainsKey(server.GUID))
         {
             statusCache[server.GUID] = new SortedDictionary <int, JiraNamedEntity>();
         }
         statusCache[server.GUID][status.Id] = status;
     }
 }
 public void addPriority(JiraServer server, JiraNamedEntity priority)
 {
     lock (priorityCache) {
         if (!priorityCache.ContainsKey(server.GUID))
         {
             priorityCache[server.GUID] = new List <JiraNamedEntity>();
         }
         priorityCache[server.GUID].Add(priority);
     }
 }
 public void addIssueType(JiraServer server, JiraNamedEntity issueType)
 {
     lock (issueTypeCache) {
         if (!issueTypeCache.ContainsKey(server.GUID))
         {
             issueTypeCache[server.GUID] = new SortedDictionary <int, JiraNamedEntity>();
         }
         issueTypeCache[server.GUID][issueType.Id] = issueType;
     }
 }
Beispiel #6
0
        public void runIssueActionWithoutParams(JiraIssue issue, JiraNamedEntity action)
        {
            var data = new {
                transition = new {
                    id = action.Id
                }
            };

            postJson(BaseUrl + REST + "issue/" + issue.Key + "/transitions", data);
        }