Esempio n. 1
0
        /// <summary>
        /// Execute POST and returns string.
        /// </summary>
        /// <param name="api"></param>
        /// <returns></returns>
        public static string Post(BacklogIssue i, string baseUrl, string apiKey)
        {
            // var i.desc;
            var url = Uri.EscapeUriString(baseUrl + @"/api/v2/issues?apiKey=" + apiKey);

            System.Diagnostics.Debug.WriteLine(url);
            var uri = new Uri(url);
            // Post結果を返す
            var res = Post(uri, GetIssueValues(i));

            Console.WriteLine(res);
            return(res);
        }
Esempio n. 2
0
        /// <summary>
        /// Convert into KVP.
        /// </summary>
        /// <returns></returns>
        private static List <KeyValuePair <string, string> > GetIssueValues(BacklogIssue i)
        {
            var val = new List <KeyValuePair <string, string> >
            {
                // new KeyValuePair<string, string>("apiKey", this._setting.APIKey),
                new KeyValuePair <string, string>("projectId", i.ProjectID),
                new KeyValuePair <string, string>("summary", i.IssueTitle),
                new KeyValuePair <string, string>("issueTypeId", i.IssueTypeID),
                new KeyValuePair <string, string>("priorityId", i.Priority.ToString()),
                new KeyValuePair <string, string>("description", i.Description),
                new KeyValuePair <string, string>("assigneeId", i.Assignee)
                //new KeyValuePair<string, string>("status", "1")
            };

            return(val);
        }