Skip to main content
Deploys
Wade Williams avatar
Written by Wade Williams
Updated over a week ago

Overview

The deploys API allows you to mark one or more items as having been deployed to a specific environment. This will then email the people following those items saying their item has been deployed to the environment specified. Additionally, you can include notes and a version number.

This would allow you to ping our API from Fabric or Capistrano when you deploy items to your staging or production environment, for instance.

/api/products/{product_id}/deploys.json

GET

Fetch all of the deploys for the given product. The result list is chronologically ordered.

Arguments

The endpoint takes an optional environment argument which will restrict the returned payload to just be that environment.

Example Response

 
[{
    "environment": "staging",
    "items": [{
        "status": "completed",
        "product": {
            "archived": false,
            "id": 1,
            "name": "sprint.ly"
        },
        "description": "http://support.sprint.ly/discussions/problems/222-not-sure-what-some-things-mean",
        "tags": ["documentation"],
        "short_url": "http://sprint.ly/i/1/2099/",
        "number": 2099,
        "last_modified": "2012-10-29T17:43:32+00:00",
        "archived": false,
        "close_reason": "fixed",
        "title": "Create FAQs that cover the various item types.",
        "created_at": "2012-01-06T01:00:48+00:00",
        "created_by": {
            "first_name": "Joe",
            "last_name": "Stump",
            "created_at": "2011-06-07T21:10:52+00:00",
            "email": "joe@joestump.net",
            "last_login": "2012-11-18T18:34:19+00:00",
            "id": 1
        },
        "score": "M",
        "assigned_to": {
            "first_name": "Joe",
            "last_name": "Stump",
            "created_at": "2011-06-07T21:10:52+00:00",
            "email": "joe@joestump.net",
            "last_login": "2012-11-18T18:34:19+00:00",
            "id": 1
        },
        "progress": {
            "closed_at": "2012-10-29T17:43:32+00:00",
            "started_at": "2012-10-29T17:43:29+00:00"
        },
        "type": "task",
        "email": {
            "files": "files-13617@items.sprint.ly",
            "discussion": "discussion-13617@items.sprint.ly"
        }
    }, {
        "status": "completed",
        "product": {
            "archived": false,
            "id": 1,
            "name": "sprint.ly"
        },
        "description": "Endpoint refactor forgot an import needed by the Transloadit signature creator endpoint.",
        "tags": [],
        "short_url": "http://sprint.ly/i/1/3413/",
        "number": 3413,
        "last_modified": "2012-11-07T20:13:57+00:00",
        "archived": false,
        "close_reason": "fixed",
        "title": "Cannot upload files on production (broken AJAX endpoint).",
        "created_at": "2012-10-29T16:02:06+00:00",
        "created_by": {
            "first_name": "Joe",
            "last_name": "Stump",
            "created_at": "2011-06-07T21:10:52+00:00",
            "email": "joe@joestump.net",
            "last_login": "2012-11-18T18:34:19+00:00",
            "id": 1
        },
        "score": "S",
        "assigned_to": {
            "first_name": "Joe",
            "last_name": "Stump",
            "created_at": "2011-06-07T21:10:52+00:00",
            "email": "joe@joestump.net",
            "last_login": "2012-11-18T18:34:19+00:00",
            "id": 1
        },
        "progress": {
            "closed_at": "2012-10-29T22:46:08+00:00",
            "started_at": "2012-10-29T22:46:06+00:00"
        },
        "type": "defect",
        "email": {
            "files": "files-191536@items.sprint.ly",
            "discussion": "discussion-191536@items.sprint.ly"
        }
    }],
    "notes": "Jenkins build #732",
    "version": "",
    "user": {
        "first_name": "Justin",
        "last_name": "Lilly",
        "created_at": "2012-07-23T17:54:30+00:00",
        "email": "justin@sage.ly",
        "last_login": "2012-11-30T18:08:45+00:00",
        "id": 5304
    }
}]

Error codes

  • 403 If the user making the request is not a member of the product_id.

  • 404 if product_id is invalid or unknown.

POST

Creates a new deploy for the given product.

Arguments

  • environment (string, required): The environment where the code has been deployed (eg 'staging', 'production', you could even put a URL in here, if you'd like).

  • numbers (string, comma separated, required): The item numbers that should be marked as deployed to the environment.

  • version (string, optional): Version number of your software

  • notes (string, optional): Any additional notes you'd like to put.

Example Response

{
    "environment": "staging",
    "items": [{
        "status": "completed",
        "product": {
            "archived": false,
            "id": 1,
            "name": "sprint.ly"
        },
        "description": "http://support.sprint.ly/discussions/problems/222-not-sure-what-some-things-mean",
        "tags": ["documentation"],
        "short_url": "http://sprint.ly/i/1/2099/",
        "number": 2099,
        "last_modified": "2012-10-29T17:43:32+00:00",
        "archived": false,
        "close_reason": "fixed",
        "title": "Create FAQs that cover the various item types.",
        "created_at": "2012-01-06T01:00:48+00:00",
        "created_by": {
            "first_name": "Joe",
            "last_name": "Stump",
            "created_at": "2011-06-07T21:10:52+00:00",
            "email": "joe@joestump.net",
            "last_login": "2012-11...skipping...
-18T18:34:19+00:00",
            "id": 1
        },
        "score": "M",
        "assigned_to": {
            "first_name": "Joe",
            "last_name": "Stump",
            "created_at": "2011-06-07T21:10:52+00:00",
            "email": "joe@joestump.net",
            "last_login": "2012-11-18T18:34:19+00:00",
            "id": 1
        },
        "progress": {
            "closed_at": "2012-10-29T17:43:32+00:00",
            "started_at": "2012-10-29T17:43:29+00:00"
        },
        "type": "task",
        "email": {
            "files": "files-13617@items.sprint.ly",
            "discussion": "discussion-13617@items.sprint.ly"
        }
    }, {
        "status": "completed",
        "product": {
            "archived": false,
            "id": 1,
            "name": "sprint.ly"
        },
        "description": "Endpoint refactor forgot an import needed by the Transloadit signature creator endpoint.",
        "tags": [],
        "sho  1 
rt_url": "http://sprint.ly/i/1/3413/",
        "number": 3413,
        "last_modified": "2012-11-07T20:13:57+00:00",
        "archived": false,
        "close_reason": "fixed",
        "title": "Cannot upload files on production (broken AJAX endpoint).",
        "created_at": "2012-10-29T16:02:06+00:00",
        "created_by": {
            "first_name": "Joe",
            "last_name": "Stump",
            "created_at": "2011-06-07T21:10:52+00:00",
            "email": "joe@joestump.net",
            "last_login": "2012-11-18T18:34:19+00:00",
            "id": 1
        },
        "score": "S",
        "assigned_to": {
            "first_name": "Joe",
            "last_name": "Stump",
            "created_at": "2011-06-07T21:10:52+00:00",
            "email": "joe@joestump.net",
            "last_login": "2012-11-18T18:34:19+00:00",
            "id": 1
        },
        "progress": {
            "closed_at": "2012-10-29T22:46:08+00:00",
            "started_at": "2012-10-29T22:46:06+00:00"
        },
        "type": "defect",
        "email": {
            "files": "files-191536@items.sprint.ly",
            "discussion": "discussion-191536@items.sprint.ly"
        }
    }],
    "notes": "Jenkins build #732",
    "version": "",
    "user": {
        "first_name": "Justin",
        "last_name": "Lilly",
        "created_at": "2012-07-23T17:54:30+00:00",
        "email": "justin@sage.ly",
        "last_login": "2012-11-30T18:08:45+00:00",
        "id": 5304
    }
} 

Error Codes

  • 404 If product_id is invalid or unknown.

  • 403 If the user making the request is not a member of the product_id.

  • 403 If environment or numbers are unspecified.

  • 400 If no items in numbers weren't found to exist.

Did this answer your question?