Get a List of Action Plans

DescriptionGet a list of action plans

URL

/api/action_plans/search

HTTP MethodGET
Response Formatsjson | xml

Security

Requires Browse permission on project

Available sinceVersion 3.6

Examples

Use CaseExample Request
Get all the action plans of the org.codehaus.sonar:sonar project

GET http://localhost:9000/api/action_plans/search?project=org.codehaus.sonar:sonar

Response Format

{
    "actionPlans":[
        {
            "key":"3f19de90-1521-4482-a737-a311758ff513",
            "name":"Version 3.6",
            "status":"OPEN",
            "project":"java-sonar-runner-simple",
            "userLogin":"admin",
            "deadLine":"2013-12-31T00:00:00+0100",
            "totalIssues":1,
            "unresolvedIssues":0,
            "createdAt":"2013-05-31T22:40:50+0200",
            "updatedAt":"2013-05-31T22:40:50+0200"
        },
        {
            "key":"8ab022c0-f0dc-41b7-a762-82502bda749f",
            "name":"Version 3.5",
            "status":"CLOSED",
            "project":"java-sonar-runner-simple4",
            "userLogin":"admin",
            "totalIssues":0,
            "unresolvedIssues":0,
            "createdAt":"2013-05-31T22:40:30+0200",
            "updatedAt":"2013-05-31T22:42:13+0200"
        }
    ]
}

Parameters

Parameter

Description

Required

Default Value

Example Value

project

Project key.

Yes

None

org.codehaus.sonar:sonar

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

Create an Action Plan

DescriptionCreate an action plan

URL

/api/action_plans/create

HTTP MethodPOST

Security

Requires Administer permission on project

Available sinceVersion 3.6

Examples

Use CaseExample Request

Create an action plan on project org.codehaus.sonar:sonar:

  • Name: Long term
  • Description: Low return on investment
  • Deadline: 2013-12-31

curl -X POST -v -u admin:admin 'http://localhost:9000/api/action_plans/create?name=Long%20term&project=org.codehaus.sonar:sonar&description=Low%20return%20on%20investment&deadLine=2013-12-31'

Parameters

Parameter

Description

Required

Default Value

Example Value

name

Name of the action plan.Yes

None

Version 3.6

project

Project key.

YesNoneorg.codehaus.sonar:sonar
descriptionDescription.NoNoneblabla
deadLine

Due date of the action plan.

Format: YYYY-MM-DD

NoNone2013-12-31

Delete an Action Plan

DescriptionDelete an action plan

URL

/api/action_plans/delete

HTTP MethodPOST

Security

Requires Administer permission on project
Available sinceVersion 3.6

Examples

Use CaseExample Request
Delete the '3f19de90-1521-4482-a737-a311758ff513' action plan

curl -X POST -v -u admin:admin 'http://localhost:9000/api/action_plans/delete?key=3f19de90-1521-4482-a737-a311758ff513 '

Parameters

Parameter

Description

Required

Default Value

Example Value

key

Key of the action plan.Yes

None

3f19de90-1521-4482-a737-a311758ff513

Update an Action Plan

DescriptionUpdate an action plan

URL

/api/action_plans/update

HTTP MethodPOST

Security

Requires Administer permission on project

Available sinceVersion 3.6

Examples

Use CaseExample Request

Update action plan '3f19de90-1521-4482-a737-a311758ff513':

  • New name: Long term 2
  • New description: Low return on investment 2
  • New deadline: 2014-12-31

curl -X POST -v -u admin:admin 'http://localhost:9000/api/action_plans/update?key=3f19de90-1521-4482-a737-a311758ff513&name=Long%20term2&description=Low%20return%20on%20investment2&deadLine=2014-12-31'

Parameters

Parameter

Description

Required

Default Value

Example Value
keyKey of the action plan.YesNone
3f19de90-1521-4482-a737-a311758ff513

name

Name of the action plan.Yes

None

Version 3.6

descriptionDescription.NoNoneblabla
deadLine

Due date of the action plan.

Format: YYYY-MM-DD

NoNone2013-12-31

Close an Action Plan

DescriptionClose an action plan

URL

/api/action_plans/close

HTTP MethodPOST

Security

Requires Administer permission on project

Available sinceVersion 3.6

Examples

Use CaseExample Request

Close action plan '3f19de90-1521-4482-a737-a311758ff513'

curl -X POST -v -u admin:admin 'http://localhost:9000/api/action_plans/close?key=3f19de90-1521-4482-a737-a311758ff513'

Parameters

Parameter

Description

Required

Default Value

Example Value
keyKey of the action plan.YesNone
3f19de90-1521-4482-a737-a311758ff513

Open an Action Plan

DescriptionOpen an action plan

URL

/api/action_plans/open

HTTP MethodPOST

Security

Requires Administer permission on project

Available sinceVersion 3.6

Examples

Use CaseExample Request

Open action plan '3f19de90-1521-4482-a737-a311758ff513'

curl -X POST -v -u admin:admin 'http://localhost:9000/api/action_plans/open?key=3f19de90-1521-4482-a737-a311758ff513'

Parameters

Parameter

Description

Required

Default Value

Example Value
keyKey of the action plan.YesNone
3f19de90-1521-4482-a737-a311758ff513