public async Task <Issue> SetIssueTypeAsync(string issue, IssueTypes type) { var queryParamValues = new Dictionary <string, object> { [nameof(issue)] = issue, [nameof(type)] = IssueTypesConverter.ToString(type) }; var response = await GetIssuesUrl("set_type") .SetQueryParams(queryParamValues) .PostAsync(s_emptyHttpContent) .ConfigureAwait(false); return(await HandleResponseFirstNodeAsync <Issue>(response).ConfigureAwait(false)); }
public async Task <IssueBulkChange> BulkChangeIssuesAsync(string[] addTags = null, string assign = null, string comment = null, string doTransition = null, string[] issues = null, string[] removeTags = null, bool?sendNotifications = null, Severities?setSeverity = null, IssueTypes?type = null) { var queryParamValues = new Dictionary <string, object> { ["add_tags"] = addTags, [nameof(assign)] = assign, [nameof(comment)] = comment, ["do_transition"] = doTransition, [nameof(issues)] = issues == null ? null : string.Join(",", issues), ["remove_tags"] = removeTags, [nameof(sendNotifications)] = BooleanConverter.ToString(sendNotifications), ["set_severity"] = setSeverity, ["set_type"] = type == null ? null : IssueTypesConverter.ToString(type) }; var response = await GetIssuesUrl("bulk_change") .SetQueryParams(queryParamValues) .PostAsync(s_emptyHttpContent) .ConfigureAwait(false); return(await HandleResponseAsync <IssueBulkChange>(response).ConfigureAwait(false)); }
public async Task <Rule> CreateRuleAsync(string customKey, string markdownDescription, string name, IDictionary <string, string> parameters = null, bool?preventReactivation = null, Severities?severity = null, RuleStatuses?status = null, string templateKey = null, IssueTypes?type = null) { var queryParamValues = new Dictionary <string, object> { ["custom_key"] = customKey, ["markdown_description"] = markdownDescription, [nameof(name)] = name, ["params"] = parameters?.Select(x => $"{x.Key}={x.Value}"), ["prevent_reactivation"] = BooleanConverter.ToString(preventReactivation), [nameof(severity)] = SeveritiesConverter.ToString(severity), [nameof(status)] = RuleStatusesConverter.ToString(status), ["template_key"] = templateKey, [nameof(type)] = IssueTypesConverter.ToString(type) }; var response = await GetRulesUrl("create") .SetQueryParams(queryParamValues) .PostAsync(s_emptyHttpContent) .ConfigureAwait(false); return(await HandleResponseFirstNodeAsync <Rule>(response).ConfigureAwait(false)); }