001    /*
002     * SonarQube, open source software quality management tool.
003     * Copyright (C) 2008-2013 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     */
020    package org.sonar.wsclient.issue;
021    
022    import javax.annotation.Nullable;
023    
024    import java.util.List;
025    
026    /**
027     * This client is a wrapper over the web services related to issues
028     *
029     * @since 3.6
030     */
031    public 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       * Change the severity of an existing issue. Supported values are "INFO", "MINOR",
047       * "MAJOR", "CRITICAL" and "BLOCKER".
048       *
049       * @return the updated issue
050       */
051      Issue setSeverity(String issueKey, String severity);
052    
053      /**
054       * Link an existing issue to an action plan. A null action plan unlinks the issue.
055       */
056      Issue plan(String issueKey, @Nullable String actionPlan);
057    
058      IssueComment addComment(String issueKey, String markdownText);
059    
060      Issue create(NewIssue issue);
061    
062      List<String> transitions(String issueKey);
063    
064      Issue doTransition(String issueKey, String transition);
065    
066      List<String> actions(String issueKey);
067    
068      Issue doAction(String issueKey, String action);
069    
070      /**
071       * Execute bulk change on a list of issues
072       */
073      BulkChange bulkChange(BulkChangeQuery query);
074    
075    }