Example #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);
        }
Example #2
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);
        }