Details

    • Type: Sub-task
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.6
    • Component/s: None
    • Labels:
      None

      Description

      Request

      GET /api/issues/search

      Optional parameters are :

      • 'issues': list of issue keys
      • 'severities': list of severity to match. See constants in {@link org.sonar.api.rule.Severity}
      • 'statuses': list of status to match. See constants in {@link Issue}
        * 'resolutions': list of resolutions to match. See constants in {@link Issue}
      • 'resolved': true to match only resolved issues, false to match only unresolved issues. By default no filtering is done.
      • 'components': list of component keys to match, for example 'org.apache.struts:struts:org.apache.struts.Action'
      • 'componentRoots': list of keys of root components. All the issues related to descendants of these roots are returned.
      • 'rules': list of keys of rules to match. Format is <repository>:<rule>, for example 'squid:AvoidCycles'
      • 'actionPlans': list of keys of the action plans to match. Note that plan names are not accepted.
      • 'planned': true to get only issues associated to an action plan, false to get only non associated issues. By default no filtering is done.
      • 'reporters': list of reporter logins. Note that reporters are defined only on "manual" issues.
      • 'assignees': list of assignee logins.
      • 'assigned': true to get only assigned issues, false to get only unassigned issues. By default no filtering is done.
      • 'createdAfter': match all the issues created after the given date (inclusive). Both date and datetime ISO formats are supported: 2013-05-18 or 2010-05-18T15:50:45+0100
      • 'createdBefore': match all the issues created before the given date (exclusive). Both date and datetime ISO formats are supported: 2013-05-18 or 2010-05-18T15:50:45+0100
      • 'pageSize': maximum number of results per page. Default is {@link org.sonar.api.issue.IssueQuery#DEFAULT_PAGE_SIZE}

        , except when the parameter 'components' is set. In this case there's no limit by default (all results in the same page).

      • 'pageIndex': index of the selected page. Default is 1.

      Response

      Both JSON and XML formats are supported. Example :

      {
      
          "securityExclusions": false,
          "paging": {
              "pageIndex": 1,
              "pageSize": 5,
              "total": 206,
              "pages": 42
          },
          "issues": [
              {
                  "key": "01fc972e-2a3c-433e-bcae-0bd7f88f5123",
                  "component": "com.github.kevinsawicki:http-request:com.github.kevinsawicki.http.HttpRequest",
                  "project": "com.github.kevinsawicki:http-request",
                  "rule": "checkstyle:com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck",
                  "status": "OPEN",
                  "severity": "MINOR",
                  "desc": "'3' is a magic number.",
                  "line": 530,
                  "creationDate": "2013-05-13T17:55:39+0200",
                  "updateDate": "2013-05-13T17:55:39+0200",
                  "comments": [
                      {
                          "key": "7d7c56f5-7b5a-41b9-87f8-36fa70caa5ba",
                          "login": "admin",
                          "htmlText": "foooooo",
                          "createdAt": "2013-05-13T18:08:34+0200"
                      }
                  ]
              },
              {
                  "key": "01e4c2ac-4275-4590-b800-5281d6077ebe",
                  "component": "com.github.kevinsawicki:http-request:com.github.kevinsawicki.http.HttpRequest",
                  "project": "com.github.kevinsawicki:http-request",
                  "rule": "checkstyle:com.puppycrawl.tools.checkstyle.checks.coding.RedundantThrowsCheck",
                  "status": "OPEN",
                  "severity": "MINOR",
                  "desc": "Redundant throws: 'HttpRequestException' is unchecked exception.",
                  "line": 914,
                  "creationDate": "2013-05-13T17:55:39+0200",
                  "updateDate": "2013-05-13T17:55:39+0200"
              },
              {
                  "key": "01a51eb9-230b-4335-8d1c-af447df10674",
                  "component": "com.github.kevinsawicki:http-request:com.github.kevinsawicki.http.HttpRequest",
                  "project": "com.github.kevinsawicki:http-request",
                  "rule": "checkstyle:com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck",
                  "status": "OPEN",
                  "severity": "MINOR",
                  "desc": "'0x3f' is a magic number.",
                  "line": 404,
                  "creationDate": "2013-05-13T17:55:39+0200",
                  "updateDate": "2013-05-13T17:55:39+0200"
              },
              {
                  "key": "016239b4-9799-4228-a9d3-093a0a5987ad",
                  "component": "com.github.kevinsawicki:http-request:com.github.kevinsawicki.http.HttpRequest",
                  "project": "com.github.kevinsawicki:http-request",
                  "rule": "squid:S00121",
                  "status": "OPEN",
                  "severity": "MAJOR",
                  "desc": "Missing curly brace.",
                  "line": 645,
                  "creationDate": "2013-05-13T17:55:39+0200",
                  "updateDate": "2013-05-13T17:55:39+0200"
              },
              {
                  "key": "003e7c5a-c05a-4074-aaa6-86416c59c667",
                  "component": "com.github.kevinsawicki:http-request:com.github.kevinsawicki.http.HttpRequest",
                  "project": "com.github.kevinsawicki:http-request",
                  "rule": "squid:S00121",
                  "status": "OPEN",
                  "severity": "MAJOR",
                  "desc": "Missing curly brace.",
                  "line": 782,
                  "creationDate": "2013-05-13T17:55:39+0200",
                  "updateDate": "2013-05-13T17:55:39+0200"
              }
          ],
          "components": [
              {
                  "key": "com.github.kevinsawicki:http-request:com.github.kevinsawicki.http.HttpRequest",
                  "qualifier": "CLA",
                  "name": "HttpRequest",
                  "longName": "com.github.kevinsawicki.http.HttpRequest"
              }
          ],
          "projects": [
          {
              "key": "com.github.kevinsawicki:http-request",
              "qualifier": "TRK",
              "name": "http-request",
              "longName": "http-request"
          }
      
          ],
          "rules": [
              {
                  "key": "squid:S00121",
                  "name": "if/else/for/while/do statements should always use curly braces",
                  "desc": "<p>\nNot using curly braces could be error-prone in some cases. For instance in the following example, the two statements seems to be attached to the if statement whereas this is the case only for the first one:\n</p>\n<pre>\nif (condition) // Non-Compliant\n executeSomething();\n checkSomething();\n\nif (condition) { // Compliant\n executeSomething();\n}\ncheckSomething();\n</pre>\n"
              },
              {
                  "key": "checkstyle:com.puppycrawl.tools.checkstyle.checks.coding.RedundantThrowsCheck",
                  "name": "Redundant Throws",
                  "desc": "Checks for redundant exceptions declared in throws clause such as duplicates, unchecked exceptions or subclasses of another declared exception."
              },
              {
                  "key": "checkstyle:com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck",
                  "name": "Magic Number",
                  "desc": "Checks for magic numbers."
              }
          ],
          "users": [
              {
                  "login": "admin",
                  "name": "Administrator",
                  "active": true
              }
          ]
      
      }
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              julien.lancelot Julien Lancelot
              Reporter:
              simon.brandhof Simon Brandhof (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: