Additional information
Custom fields
If you have custom fields setup for test plans within the given project, the custom field data is exposed here. It is recommend that you take a look at the custom field resource documentation which will explain the format and how to match the values to the field names / ID's.
List
Description: Provides a paginated list of all test plan content within a given plan.
Endpoint: <base_url>/projects/{project_id}/plans/{plan_id}/plan_contents.json
Request: GET
Formats supported: JSON
Params:
- project_id - {Integer} The associated project ID (Required)
- plan_id - {Integer} The associated test plan ID (Required)
- page - {Integer} of the page (Default: 1)
Response
{
"pagination": { .... },
"plan_contents": [
{
....,
"custom_fields": [
{ .... },
{ .... }
]
},
{
....,
"custom_fields": [
{ .... },
{ .... }
]
}
]
}
Example ruby request
HTTParty.get('https://api.testlodge.com/v1/account/1/projects/1/plans/1/plan_contents.json')
Example Response
Response code: 200
{
"pagination": {
"total_entries":2,
"total_pages":1,
"current_page":1,
"next_page":null,
"previous_page":null,
"per_page":20
},
"plan_contents":[{
"id":1,
"title":"Plan content title",
"content": "The content",
"position":1,
"plan_id":1,
"last_saved_by_id":2,
"custom_fields": [{
"id":1,
"name":"Further details",
"value":"Some further details that should be included"
}],
"created_at":"2014-02-26T14:33:58Z",
"updated_at":"2014-02-26T14:33:58Z"
},
{ .... }]
}
Show
Description: Get the details for a test plan content.
Endpoint: <base_url>/projects/{project_id}/plans/{plan_id}/plan_contents/{id}.json
Request: GET
Formats supported: JSON
Params:
- project_id - {Integer} The associated project ID (Required)
- plan_id - {Integer} The associated test plan ID (Required)
- id - {Integer} The test plan content ID (Required)
Response
{
....,
"last_saved_by": { .... },
"custom_fields": [
{ .... },
{ .... }
]
}
Example ruby request
HTTParty.get('https://api.testlodge.com/v1/account/1/projects/1/plans/1/plan_contents/1.json')
Example Response
Response code: 200
{
"id":1,
"title":"Plan content title",
"content": "The content",
"position":1,
"plan_id":1,
"last_saved_by_id":2,
"last_saved_by": {
"id":2,
"firstname":"Jon",
"lastname":"Cole",
"email":"jon@example.com",
"created_at":"2014-02-26T14:33:58Z",
"updated_at":"2014-02-26T14:33:58Z"
},
"custom_fields": [{
"id":1,
"name":"Further details",
"value":"Some further details that should be included"
}],
"created_at":"2014-02-26T14:33:58Z",
"updated_at":"2014-02-26T14:33:58Z"
}
Create
Description: Create a new test plan content.
Endpoint: <base_url>/projects/{project_id}/plans/{plan_id}/plan_contents.json
Request: POST
Formats supported: JSON
Params:
- project_id - {Integer} The associated project ID (Required)
- plan_id - {Integer} The associated test plan ID (Required)
- plan_content:
- title - {String} The test plan content title / heading (Required)
- content - {Text} The body text of content
- custom_fields:
- field_{custom_field_id} - {String, Text or Integer} See custom field resource documentation for further details
Response
{
....,
"last_saved_by": { .... },
"custom_fields": [
{ .... },
{ .... }
]
}
Example ruby request
HTTParty.post('https://api.testlodge.com/v1/account/1/projects/1/plans/1/plan_contents.json', body: {
plan_content: {
title: 'Risks and contingencies',
content: 'The body text',
custom_fields: {
field_1: 'Some further details that should be included'
}
}
})
Example Response
Response code: 201
{
"id":1,
"title":"Risks and contingencies",
"content": "The body text",
"position":1,
"plan_id":1,
"last_saved_by_id":2,
"last_saved_by": {
"id":2,
"firstname":"Jon",
"lastname":"Cole",
"email":"jon@example.com",
"created_at":"2014-02-26T14:33:58Z",
"updated_at":"2014-02-26T14:33:58Z"
},
"custom_fields": [{
"id":1,
"name":"Further details",
"value":"Some further details that should be included"
}],
"created_at":"2014-02-26T14:33:58Z",
"updated_at":"2014-02-26T14:33:58Z"
}
Update
Description: Update a test plan content.
Endpoint: <base_url>/projects/{project_id}/plans/{plan_id}/plan_contents/{id}.json
Request: PATCH
Formats supported: JSON
Params:
- project_id - {Integer} The associated project ID (Required)
- plan_id - {Integer} The associated test plan ID (Required)
- id - {Integer} The test plan content ID (Required)
- plan_content:
- title - {String} The test plan content title / heading
- content - {Text} The body text of content
-
custom_fields:
- field_{custom_field_id} - {String, Text or Integer} See custom field resource documentation for further details
Response
{
....,
"last_saved_by": { .... },
"custom_fields": [
{ .... },
{ .... }
]
}
Example ruby request
HTTParty.patch('https://api.testlodge.com/v1/account/1/projects/1/plans/1/plan_contents/1.json', body: {
plan_content: {
title: 'New name'
}
})
Example Response
Response code: 200
{
"id":1,
"title":"New name",
"content": "The body text",
"position":1,
"plan_id":1,
"last_saved_by_id":2,
"last_saved_by": {
"id":2,
"firstname":"Jon",
"lastname":"Cole",
"email":"jon@example.com",
"created_at":"2014-02-26T14:33:58Z",
"updated_at":"2014-02-26T14:33:58Z"
},
"custom_fields": [{
"id":1,
"name":"Further details",
"value":"Some further details that should be included"
}],
"created_at":"2014-02-26T14:33:58Z",
"updated_at":"2014-02-26T14:33:58Z"
}
Delete
Description: Delete a test plan content.
Endpoint: <base_url>/projects/{project_id}/plans/{plan_id}/plan_contents/{id}.json
Request: DELETE
Formats supported: JSON
Params:
- project_id - {Integer} The associated project ID (Required)
- plan_id - {Integer} The associated test plan ID (Required)
- id - {Integer} The test plan content ID (Required)
Response
empty
Example ruby request
HTTParty.delete('https://api.testlodge.com/v1/account/1/projects/1/plans/1/plan_contents/1.json')
Example Response
Response code: 204
empty
Comments
Article is closed for comments.