Requirements API


POST /api/v1/features/:feature_id/requirements

Create a requirement

When creating a Requirement at least the name, description and status must be specified.

Parameters

Name Description
feature_id * Numeric ID, or key of the feature the requirement should be created in

POST /api/v1/features/PRJ1-1/requirements

Example CURL command

curl "https://secure.aha.io/api/v1/features/PRJ1-1/requirements" -d '{"requirement":{"name":"New name","workflow_status":{"name":"Designed"},"description":"\u003cp\u003eThis is the description\u003c/p\u003e","assigned_to_user":{"email":"henry.humpty@account1.com"}}}' -X POST \
	-H "Authorization: Bearer 15b60d42d4bc417284a246ced6877b0bf13fb4aca415f7b55f7006bc3694a8ab" \
	-H "X-Aha-Account: account1" \
	-H "Content-Type: application/json" \
	-H "Accept: application/json"

Request

Authorization: Bearer 15b60d42d4bc417284a246ced6877b0bf13fb4aca415f7b55f7006bc3694a8ab
X-Aha-Account: account1
Content-Type: application/json
Accept: application/json
{
  "requirement": {
    "name": "New name",
    "workflow_status": {
      "name": "Designed"
    },
    "description": "<p>This is the description</p>",
    "assigned_to_user": {
      "email": "henry.humpty@account1.com"
    }
  }
}

Response

Status: 200 OK
  Content-Type: application/json; charset=utf-8
{
  "requirement": {
    "id": "6488044277481252721",
    "name": "New name",
    "reference_num": "PRJ1-1-1",
    "position": 2,
    "created_at": "2017-11-13T23:25:25.181Z",
    "updated_at": "2017-11-13T23:25:25.181Z",
    "release_id": 278327321,
    "workflow_status": {
      "id": "962984386",
      "name": "Designed",
      "complete": false
    },
    "url": "http://account1.example.org/requirements/PRJ1-1-1",
    "resource": "http://account1.example.org/api/v1/requirements/PRJ1-1-1",
    "description": {
      "id": "6488044277548510650",
      "body": "<p>This is the description</p>",
      "created_at": "2017-11-13T23:25:25.196Z",
      "attachments": [

      ]
    },
    "feature": {
      "id": "1007868956",
      "reference_num": "PRJ1-1",
      "name": "Feature 1",
      "created_at": "2017-11-13T23:24:40.000Z",
      "url": "http://account1.example.org/features/PRJ1-1",
      "resource": "http://account1.example.org/api/v1/features/PRJ1-1"
    },
    "assigned_to_user": {
      "id": "689956296",
      "name": "Henry Humpty",
      "email": "henry.humpty@account1.com",
      "created_at": "2017-11-13T23:24:40.000Z",
      "updated_at": "2017-11-13T23:24:40.000Z",
      "default_assignee": false
    },
    "created_by_user": {
      "id": "1020675218",
      "name": "Mary Humpty",
      "email": "mary.humpty@account1.com",
      "created_at": "2017-11-13T23:24:40.000Z",
      "updated_at": "2017-11-13T23:24:40.000Z"
    },
    "attachments": [

    ],
    "custom_fields": [

    ],
    "integration_fields": [

    ],
    "comments_count": 0
  }
}

GET /api/v1/requirements/:id

Get a specific requirement

Parameters

Name Description
id * Numeric ID, or key of the requirement to be retrieved

GET /api/v1/requirements/PRJ1-1-1

Example CURL command

curl -g "https://secure.aha.io/api/v1/requirements/PRJ1-1-1" -X GET \
	-H "Authorization: Bearer 15b60d42d4bc417284a246ced6877b0bf13fb4aca415f7b55f7006bc3694a8ab" \
	-H "X-Aha-Account: account1" \
	-H "Content-Type: application/json" \
	-H "Accept: application/json"

Request

Authorization: Bearer 15b60d42d4bc417284a246ced6877b0bf13fb4aca415f7b55f7006bc3694a8ab
X-Aha-Account: account1
Content-Type: application/json
Accept: application/json

Response

Status: 200 OK
  Content-Type: application/json; charset=utf-8
{
  "requirement": {
    "id": "483368544",
    "name": "Body of requirement 1",
    "reference_num": "PRJ1-1-1",
    "position": 1,
    "created_at": "2017-11-13T23:24:40.000Z",
    "updated_at": "2017-11-13T23:24:40.000Z",
    "release_id": 278327321,
    "workflow_status": {
      "id": "934242751",
      "name": "New",
      "complete": false
    },
    "url": "http://account1.example.org/requirements/PRJ1-1-1",
    "resource": "http://account1.example.org/api/v1/requirements/PRJ1-1-1",
    "description": {
      "id": "910541534",
      "body": "Body of requirement 1",
      "created_at": "2017-11-13T23:24:40.000Z",
      "attachments": [

      ]
    },
    "feature": {
      "id": "1007868956",
      "reference_num": "PRJ1-1",
      "name": "Feature 1",
      "created_at": "2017-11-13T23:24:40.000Z",
      "url": "http://account1.example.org/features/PRJ1-1",
      "resource": "http://account1.example.org/api/v1/features/PRJ1-1"
    },
    "assigned_to_user": {
      "id": "689956296",
      "name": "Henry Humpty",
      "email": "henry.humpty@account1.com",
      "created_at": "2017-11-13T23:24:40.000Z",
      "updated_at": "2017-11-13T23:24:40.000Z",
      "default_assignee": true
    },
    "created_by_user": {
      "id": "1020675218",
      "name": "Mary Humpty",
      "email": "mary.humpty@account1.com",
      "created_at": "2017-11-13T23:24:40.000Z",
      "updated_at": "2017-11-13T23:24:40.000Z"
    },
    "attachments": [

    ],
    "custom_fields": [
      {
        "key": "expected_completion_date",
        "name": "Expected completion date",
        "value": null,
        "type": "date"
      }
    ],
    "integration_fields": [

    ],
    "comments_count": 0
  }
}

PUT /api/v1/requirements/:id

Update a requirement

Parameters

Name Description
id * Numeric ID, or key of the requirement to be edited

PUT /api/v1/requirements/PRJ1-1-1

Example CURL command

curl "https://secure.aha.io/api/v1/requirements/PRJ1-1-1" -d '{"requirement":{"name":"Another name","workflow_status":{"name":"Designed"},"description":"\u003cp\u003enew description\u003c/p\u003e"}}' -X PUT \
	-H "Authorization: Bearer 15b60d42d4bc417284a246ced6877b0bf13fb4aca415f7b55f7006bc3694a8ab" \
	-H "X-Aha-Account: account1" \
	-H "Content-Type: application/json" \
	-H "Accept: application/json"

Request

Authorization: Bearer 15b60d42d4bc417284a246ced6877b0bf13fb4aca415f7b55f7006bc3694a8ab
X-Aha-Account: account1
Content-Type: application/json
Accept: application/json
{
  "requirement": {
    "name": "Another name",
    "workflow_status": {
      "name": "Designed"
    },
    "description": "<p>new description</p>"
  }
}

Response

Status: 200 OK
  Content-Type: application/json; charset=utf-8
{
  "requirement": {
    "id": "483368544",
    "name": "Another name",
    "reference_num": "PRJ1-1-1",
    "position": 1,
    "created_at": "2017-11-13T23:24:40.000Z",
    "updated_at": "2017-11-13T23:25:25.499Z",
    "release_id": 278327321,
    "workflow_status": {
      "id": "962984386",
      "name": "Designed",
      "complete": false
    },
    "url": "http://account1.example.org/requirements/PRJ1-1-1",
    "resource": "http://account1.example.org/api/v1/requirements/PRJ1-1-1",
    "description": {
      "id": "910541534",
      "body": "<p>new description</p>",
      "created_at": "2017-11-13T23:24:40.000Z",
      "attachments": [

      ]
    },
    "feature": {
      "id": "1007868956",
      "reference_num": "PRJ1-1",
      "name": "Feature 1",
      "created_at": "2017-11-13T23:24:40.000Z",
      "url": "http://account1.example.org/features/PRJ1-1",
      "resource": "http://account1.example.org/api/v1/features/PRJ1-1"
    },
    "assigned_to_user": {
      "id": "689956296",
      "name": "Henry Humpty",
      "email": "henry.humpty@account1.com",
      "created_at": "2017-11-13T23:24:40.000Z",
      "updated_at": "2017-11-13T23:24:40.000Z",
      "default_assignee": true
    },
    "created_by_user": {
      "id": "1020675218",
      "name": "Mary Humpty",
      "email": "mary.humpty@account1.com",
      "created_at": "2017-11-13T23:24:40.000Z",
      "updated_at": "2017-11-13T23:24:40.000Z"
    },
    "attachments": [

    ],
    "custom_fields": [
      {
        "key": "expected_completion_date",
        "name": "Expected completion date",
        "value": null,
        "type": "date"
      }
    ],
    "integration_fields": [

    ],
    "comments_count": 0
  }
}

PUT /api/v1/requirements/:id

Update a requirement's custom fields

Parameters

Name Description
id * Numeric ID, or key of the requirement to be edited

PUT /api/v1/requirements/PRJ1-1-1

Example CURL command

curl "https://secure.aha.io/api/v1/requirements/PRJ1-1-1" -d '{"requirement":{"custom_fields":{"priority":"P3"}}}' -X PUT \
	-H "Authorization: Bearer 15b60d42d4bc417284a246ced6877b0bf13fb4aca415f7b55f7006bc3694a8ab" \
	-H "X-Aha-Account: account1" \
	-H "Content-Type: application/json" \
	-H "Accept: application/json"

Request

Authorization: Bearer 15b60d42d4bc417284a246ced6877b0bf13fb4aca415f7b55f7006bc3694a8ab
X-Aha-Account: account1
Content-Type: application/json
Accept: application/json
{
  "requirement": {
    "custom_fields": {
      "priority": "P3"
    }
  }
}

Response

Status: 200 OK
  Content-Type: application/json; charset=utf-8
{
  "requirement": {
    "id": "483368544",
    "name": "Body of requirement 1",
    "reference_num": "PRJ1-1-1",
    "position": 1,
    "created_at": "2017-11-13T23:24:40.000Z",
    "updated_at": "2017-11-13T23:24:40.000Z",
    "release_id": 278327321,
    "workflow_status": {
      "id": "934242751",
      "name": "New",
      "complete": false
    },
    "url": "http://account1.example.org/requirements/PRJ1-1-1",
    "resource": "http://account1.example.org/api/v1/requirements/PRJ1-1-1",
    "description": {
      "id": "910541534",
      "body": "Body of requirement 1",
      "created_at": "2017-11-13T23:24:40.000Z",
      "attachments": [

      ]
    },
    "feature": {
      "id": "1007868956",
      "reference_num": "PRJ1-1",
      "name": "Feature 1",
      "created_at": "2017-11-13T23:24:40.000Z",
      "url": "http://account1.example.org/features/PRJ1-1",
      "resource": "http://account1.example.org/api/v1/features/PRJ1-1"
    },
    "assigned_to_user": {
      "id": "689956296",
      "name": "Henry Humpty",
      "email": "henry.humpty@account1.com",
      "created_at": "2017-11-13T23:24:40.000Z",
      "updated_at": "2017-11-13T23:24:40.000Z",
      "default_assignee": true
    },
    "created_by_user": {
      "id": "1020675218",
      "name": "Mary Humpty",
      "email": "mary.humpty@account1.com",
      "created_at": "2017-11-13T23:24:40.000Z",
      "updated_at": "2017-11-13T23:24:40.000Z"
    },
    "attachments": [

    ],
    "custom_fields": [
      {
        "key": "priority",
        "name": "Priority",
        "value": "P3",
        "type": "string"
      },
      {
        "key": "expected_completion_date",
        "name": "Expected completion date",
        "value": null,
        "type": "date"
      }
    ],
    "integration_fields": [

    ],
    "comments_count": 0
  }
}

POST /api/v1/requirements/:id/convert_to_feature

Convert a requirement to a feature

Parameters

Name Description
id * Numeric ID, or key of the requirement to be converted

POST /api/v1/requirements/PRJ1-1-1/convert_to_feature

Example CURL command

curl "https://secure.aha.io/api/v1/requirements/PRJ1-1-1/convert_to_feature" -d '' -X POST \
	-H "Authorization: Bearer 15b60d42d4bc417284a246ced6877b0bf13fb4aca415f7b55f7006bc3694a8ab" \
	-H "X-Aha-Account: account1" \
	-H "Content-Type: application/json" \
	-H "Accept: application/json"

Request

Authorization: Bearer 15b60d42d4bc417284a246ced6877b0bf13fb4aca415f7b55f7006bc3694a8ab
X-Aha-Account: account1
Content-Type: application/json
Accept: application/json

Response

Status: 200 OK
  Content-Type: application/json; charset=utf-8
{
  "feature": {
    "id": "6488044280272406929",
    "name": "Body of requirement 1",
    "reference_num": "PRJ1-3",
    "position": 1,
    "score": 2,
    "created_at": "2017-11-13T23:25:25.826Z",
    "updated_at": "2017-11-13T23:25:25.932Z",
    "start_date": null,
    "due_date": null,
    "workflow_kind": {
      "id": "98484309",
      "name": "New"
    },
    "workflow_status": {
      "id": "934242751",
      "name": "New",
      "complete": false
    },
    "description": {
      "id": "910541534",
      "body": "Body of requirement 1",
      "created_at": "2017-11-13T23:24:40.000Z",
      "attachments": [

      ]
    },
    "attachments": [

    ],
    "integration_fields": [

    ],
    "url": "http://account1.example.org/features/PRJ1-3",
    "resource": "http://account1.example.org/api/v1/features/PRJ1-3",
    "release": {
      "id": "278327321",
      "reference_num": "PRJ1-R-1",
      "name": "Release 1",
      "start_date": "2017-11-20",
      "release_date": "2017-11-20",
      "parking_lot": false,
      "created_at": "2017-11-13T23:24:40.000Z",
      "integration_fields": [
        {
          "id": "68217473",
          "name": "id",
          "value": "777",
          "integration_id": 204584239,
          "service_name": "jira",
          "created_at": "2017-11-13T23:24:40.000Z"
        }
      ],
      "url": "http://account1.example.org/releases/PRJ1-R-1",
      "resource": "http://account1.example.org/api/v1/releases/PRJ1-R-1",
      "owner": {
        "id": "16338845",
        "name": "John Smith",
        "email": "john.smith@account1.com",
        "created_at": "2017-11-13T23:24:40.000Z",
        "updated_at": "2017-11-13T23:24:40.000Z"
      },
      "project": {
        "id": "131414752",
        "reference_prefix": "PRJ1",
        "name": "Project 1",
        "product_line": false,
        "created_at": "2017-11-13T23:24:40.000Z"
      }
    },
    "created_by_user": {
      "id": "1020675218",
      "name": "Mary Humpty",
      "email": "mary.humpty@account1.com",
      "created_at": "2017-11-13T23:24:40.000Z",
      "updated_at": "2017-11-13T23:24:40.000Z"
    },
    "assigned_to_user": {
      "id": "689956296",
      "name": "Henry Humpty",
      "email": "henry.humpty@account1.com",
      "created_at": "2017-11-13T23:24:40.000Z",
      "updated_at": "2017-11-13T23:24:40.000Z",
      "default_assignee": true
    },
    "requirements": [

    ],
    "goals": [

    ],
    "comments_count": 0,
    "score_facts": [

    ],
    "tags": [

    ],
    "custom_fields": [
      {
        "key": "expected_completion_date",
        "name": "Expected completion date",
        "value": null,
        "type": "date"
      }
    ],
    "feature_links": [
      {
        "link_type": "Relates to",
        "link_type_id": 10,
        "created_at": "2017-11-13T23:25:25.863Z",
        "parent_record": {
          "id": "1007868956",
          "reference_num": "PRJ1-1",
          "name": "Feature 1",
          "created_at": "2017-11-13T23:24:40.000Z",
          "url": "http://account1.example.org/features/PRJ1-1",
          "resource": "http://account1.example.org/api/v1/features/PRJ1-1"
        },
        "child_record": {
          "id": "6488044280272406929",
          "reference_num": "PRJ1-3",
          "name": "Body of requirement 1",
          "created_at": "2017-11-13T23:25:25.826Z",
          "url": "http://account1.example.org/features/PRJ1-3",
          "resource": "http://account1.example.org/api/v1/features/PRJ1-3"
        }
      }
    ]
  }
}

DELETE /api/v1/requirements/:id

Delete a requirement

Parameters

Name Description
id * Numeric ID, or key of the requirement to be deleted

DELETE /api/v1/requirements/PRJ1-1-1

Example CURL command

curl "https://secure.aha.io/api/v1/requirements/PRJ1-1-1" -d '' -X DELETE \
	-H "Authorization: Bearer 15b60d42d4bc417284a246ced6877b0bf13fb4aca415f7b55f7006bc3694a8ab" \
	-H "X-Aha-Account: account1" \
	-H "Content-Type: application/json" \
	-H "Accept: application/json"

Request

Authorization: Bearer 15b60d42d4bc417284a246ced6877b0bf13fb4aca415f7b55f7006bc3694a8ab
X-Aha-Account: account1
Content-Type: application/json
Accept: application/json

Response

Status: 204 No Content
  

Overview

API Resources