Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

DescriptionGet a list of issues

URL

/api/issues/search

HTTP MethodGET
Response Formatsjson | xml

Security

Requires User role Browse permission on project(s)

Available sinceVersion 3.6

...

Code Block
titleJSON
languagejavascript
{

    "securityExclusions": false,
    "maxResultsReached": 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": "OPENRESOLVED",
            "resolution": "FALSE-POSITIVE",
            "severity": "MINOR",
            "descmessage": "'3' is a magic number.",
            "line": 530,
            "author": "Developer 1",
            "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"
                }
            ]
        },
        ...
    ],
    "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": "checkstyle:com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck",
            "name": "Magic Number",
            "desc": "Checks for magic numbers.",
            "status": "READY"
        },
        ...
    ],
    "users": [
        {
            "login": "admin",
            "name": "Administrator",
            "active": true,
            "email": admin@sonarqube.org
        }
    ]

}
Info
titleMaximum number of results

If the number of issues is greater than 10,000, only the first 10,000 ones are returned by the web service.

...

Parameter

Description

Required

Default Value

Example Value

issues

Comma-separated list of issue keys.

No

None

5bccd6e8-f525-43a2-8d76-fcb13dde79ef
severities

Comma-separated list of severities.

Possible values: BLOCKER | CRITICAL | MAJOR | MINOR | INFO

NoNoneBLOCKER,CRITICAL
statuses

Comma-separated list of statuses.

Possible values: OPEN | REOPENED | CONFIRMED | RESOLVED | CLOSED

NoNoneOPEN,REOPENED
resolutions

Comma-separated list of resolutions.

Possible values: FIXED,REMOVED,FALSE-POSITIVE

NoNoneFIXED,REMOVED
resolved

To match resolved or unresolved issues.

Possible values: true | false

NoNonetrue
componentsTo retrieve issues associated to a specific list of components (comma-separated list of component keys). Note that if you set the value to a project key, only issues associated to this project are retrieved. Issues associated to its sub-components (such as files, packages, etc.) are not retrieved. See also componentRoots.NoNoneorg.apache.struts:struts:org.apache.struts.Action
componentRootsTo retrieve issues associated to a specific list of components and their sub-components (comma-separated list of component keys). Views are not supported.NoNoneorg.apache.struts:struts
rules

Comma-separated list of coding rule keys.

Format is <repository>:<rule>

NoNonesquid:AvoidCycles
actionPlansComma-separated list of action plan keys (not names).NoNone3f19de90-1521-4482-a737-a311758ff513
planned

To retrieve issues associated to an action plan or not.

Possible values: ture true | false

NoNonetrue
reportersComma-separated list of reporter logins.NoNoneadmin
assigneesComma-separated list of assignee logins.NoNoneadmin,usera
assigned

To retrieve assigned or unassigned issues.

Possible values: true | false

NoNonetrue
createdAfter

To retrieve issues created after the given date (inclusive).

Format: date or datetime ISO formats

NoNone2013-05-01 (or 2013-05-01T13:00:00+0100)
createdBefore

To retrieve issues created before the given date (exclusive).

Format: date or datetime ISO formats

NoNone2013-05-01 (or 2013-05-01T13:00:00+0100)
pageSize

Maximum number of results per page.

Default value: 100 (except when the 'components' parameter is set, value is set to "-1" in this case)

If set to "-1", the max possible value is used.

NoNone50
pageIndex

Index of the selected page

Default value: 1

NoNone2
format

Response format can be set through:

  • Parameter format: xml | json
  • Or the 'Accept' property in the HTTP header:
    • Accept:text/xml
    • Accept:application/json
If nothing is set, json is used.
NoNonejson

...

DescriptionAssign/Unassign an issue

URL

/api/issues/assign

HTTP MethodPOST

Security

Requires authentication and User role Browse permission on project

Available sinceVersion 3.6

...

DescriptionAdd a comment

URL

/api/issues/add_comment

HTTP MethodPOST

Security

Requires authentication and User role Browse permission on project
Available sinceVersion 3.6

...

DescriptionDelete a comment

URL

/api/issues/delete_comment

HTTP MethodPOST

Security

Requires authentication and User role Browse permission on project
Available sinceVersion 3.6

...

DescriptionChange severity

URL

/api/issues/set_severity

HTTP MethodPOST

Security

Requires authentication and User role Browse permission on project
Available sinceVersion 3.6

...

DescriptionPlan/Unplan an issue

URL

/api/issues/plan

HTTP MethodPOST

Security

Requires authentication and User role Browse permission on project
Available sinceVersion 3.6

...

DescriptionDo workflow transition on an issue

URL

/api/issues/do_transition

HTTP MethodPOST

Security

Requires authentication and User role Browse permission on project
Available sinceVersion 3.6

...

DescriptionGet Possible Workflow Transitions for an Issue

URL

/api/issues/transitions

HTTP MethodGET

Security

Requires User role Browse permission on the project

Available sinceVersion 3.6

...

DescriptionCreate a manual issue

URL

/api/issues/create

HTTP MethodPOST

Security

Requires authentication and User role Browse permission on project

Available sinceVersion 3.6

...

Use CaseExample Request

The 'admin' user creates a new manual issue:

  • Component: commons-io:commons-io:org.apache.commons.io.filefilter.OrFileFilter
  • Manual rule: manual:performance
  • Line: 2
  • Severity: BLOCKER
  • Description: blabla

curl -X POST -v -u admin:admin 'http://localhost:9000/api/issues/create?component=commons-io:commons-io:org.apache.commons.io.filefilter.OrFileFiltermyproject:myfile&rule=manual:performance&line=2&severity=BLOCKER&message=blabla'

...

Parameter

Description

Required

Default Value

Example Value
issuesComma-separated list of issue keys.Yes

None

01fc972e-2a3c-433e-bcae-0bd7f88f5123,
01fc972e-2a3c-433e-bcae-0bd7f88f9999
actions

Comma-separated list of actions to perform.

Possible values: assign | set_severity | plan | do_transition

YesNoneassign,plan
assign.assignee

To assign the list of issues to a specific user (login), or unassign all the issues.

NoNonesbrandhof
set_severity.severity

To change the severity of the list of issues.

Possible values: BLOCKER | CRITICAL | MAJOR | MINOR | INFO

NoNoneBLOCKER
plan.planTo plan the list of issues to a specific action plan (key), or unlink all the issues from an action plan.NoNone3f19de90-1521-4482-a737-a311758ff513
do_transition.transitionPossible values: resolve | confirm | reopen | unconfirm | falsepositiveNoNoneconfirm
commentTo add a comment to a list of issuesNoNoneblabla...
sendNotifications

Possible values: true | false

Available since version 4.0.

Nofalsetrue