Exemplo n.º 1
0
        public async Task <IEnumerable <JiraTransition> > GetPossibleTransitions()
        {
            HttpResponseMessage response =
                await this.JiraRestClient.Get(JiraEndpoint.ForTransitions(this.Key));

            if (!response.IsSuccessStatusCode)
            {
                return(null); // TODO
            }
            string json = await response.Content.ReadAsStringAsync();

            JiraResponse jiraResponse = JsonConvert.DeserializeObject <JiraResponse>(json);

            return(jiraResponse.Transitions);
        }
Exemplo n.º 2
0
        public async Task <JiraResponse> SubmitComment(string issueKey, string commentText)
        {
            var body = new { body = commentText };

            HttpResponseMessage response = await this.jiraRestClient.Post(
                JiraEndpoint.ForComment(issueKey),
                body);

            if (!response.IsSuccessStatusCode)
            {
                return(null); // TODO
            }
            string json = await response.Content.ReadAsStringAsync();

            JiraResponse jiraResponse = JsonConvert.DeserializeObject <JiraResponse>(json);

            return(jiraResponse);
        }
Exemplo n.º 3
0
        public async Task <JiraResponse> TransitionTo(string transitionName)
        {
            string transitionId = await GetTransitionId(transitionName);

            if (transitionId == null)
            {
                return(null); // TODO
            }
            var body = new { transition = new { id = transitionId } };

            HttpResponseMessage response = await this.JiraRestClient.Post(
                JiraEndpoint.ForTransitions(this.Key),
                body);

            if (!response.IsSuccessStatusCode)
            {
                return(null); // TODO
            }
            string json = await response.Content.ReadAsStringAsync();

            JiraResponse jiraResponse = JsonConvert.DeserializeObject <JiraResponse>(json);

            return(jiraResponse);
        }