Esempio n. 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);
        }
Esempio n. 2
0
 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;
     }
 }
Esempio n. 3
0
 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;
     }
 }
Esempio n. 4
0
 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);
     }
 }
Esempio n. 5
0
 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;
     }
 }
Esempio n. 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);
        }