Exemple #1
0
        /// <summary>
        /// Edits a custom field on an issue.
        /// </summary>
        /// <param name="issue">The issue to edit the field on.</param>
        /// <param name="name">The name of the custom Issue field to edit.</param>
        /// <param name="value">The new value of the field.</param>
        public void EditField(Issue issue, string name, object value)
        {
            if (issue == null)
            {
                throw new ArgumentNullException("issue");
            }

            var update = new UpdateFieldInput(name);

            update.AddOperation(StandardOperation.Set, value);

            var json = IssueEditMetaJsonGenerator.Generate(new List <UpdateFieldInput> {
                update
            });

            client.Put <JsonObject>(issue.Self.ToString(), json);
        }
Exemple #2
0
        /// <summary>
        /// Removes a label from an issue.
        /// </summary>
        /// <param name="issue">The issue to remove the label from.</param>
        /// <param name="label">The label to remove.</param>
        public void RemoveLabel(Issue issue, string label)
        {
            if (issue == null)
            {
                throw new ArgumentNullException("issue");
            }

            if (string.IsNullOrWhiteSpace(label))
            {
                throw new ArgumentException("Label cannot be empty", "label");
            }

            var update = new UpdateFieldInput(IssueFieldId.Labels);

            update.AddOperation(StandardOperation.Remove, label);

            var json = IssueEditMetaJsonGenerator.Generate(new List <UpdateFieldInput> {
                update
            });

            client.Put <JsonObject>(issue.Self.ToString(), json);
        }