001/*
002 * SonarQube, open source software quality management tool.
003 * Copyright (C) 2008-2014 SonarSource
004 * mailto:contact AT sonarsource DOT com
005 *
006 * SonarQube is free software; you can redistribute it and/or
007 * modify it under the terms of the GNU Lesser General Public
008 * License as published by the Free Software Foundation; either
009 * version 3 of the License, or (at your option) any later version.
010 *
011 * SonarQube is distributed in the hope that it will be useful,
012 * but WITHOUT ANY WARRANTY; without even the implied warranty of
013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
014 * Lesser General Public License for more details.
015 *
016 * You should have received a copy of the GNU Lesser General Public License
017 * along with this program; if not, write to the Free Software Foundation,
018 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
019 */
020package org.sonar.wsclient.issue;
021
022import javax.annotation.Nullable;
023
024import java.util.List;
025
026/**
027 * This client is a wrapper over the web services related to issues
028 *
029 * @since 3.6
030 */
031public interface IssueClient {
032
033  /**
034   * Wrap the web service /api/issues/search in order to search for issues.
035   */
036  Issues find(IssueQuery query);
037
038  /**
039   * Assign an existing issue to a user. A null assignee removes the assignee.
040   *
041   * @return the updated issue
042   */
043  Issue assign(String issueKey, @Nullable String assignee);
044
045  /**
046   * Assign an existing issue to current user.
047   *
048   * @return the updated issue
049   */
050  Issue assignToMe(String issueKey);
051
052
053  /**
054   * Change the severity of an existing issue. Supported values are "INFO", "MINOR",
055   * "MAJOR", "CRITICAL" and "BLOCKER".
056   *
057   * @return the updated issue
058   */
059  Issue setSeverity(String issueKey, String severity);
060
061  /**
062   * Link an existing issue to an action plan. A null action plan unlinks the issue.
063   */
064  Issue plan(String issueKey, @Nullable String actionPlan);
065
066  IssueComment addComment(String issueKey, String markdownText);
067
068  Issue create(NewIssue issue);
069
070  List<String> transitions(String issueKey);
071
072  Issue doTransition(String issueKey, String transition);
073
074  List<String> actions(String issueKey);
075
076  Issue doAction(String issueKey, String action);
077
078  /**
079   * Execute bulk change on a list of issues
080   */
081  BulkChange bulkChange(BulkChangeQuery query);
082
083  /**
084   * @since 4.1
085   *
086   * @return the list of changes of an issue
087   */
088  List<IssueChange> changes(String issueKey);
089
090}