Skip to content

Branch_Copy#


Description#

This function allows you to copy one branch to another, based on a specific changeset from the source branch.

Note

A branch copy will take all changes up to (and including) the selected changeset and overwrite the destination branch with those changes.

Requirements#

Miva version 10.00.00 or later.

Request Body Parameters#

Parameter
Type Description
Source_Branch_ID Number The ID of the source branch you wish to copy from. The Branch ID is returned in BranchList_Load_Query
Destination_Branch_ID Number ID of the destination branch you wish to copy to. The Branch ID is returned in BranchList_Load_Query
Source_Changeset_ID Number ID of the changeset you wish to copy. The Changeset ID is returned in ChangesetList_Load_Query
Notes String Optional. Notes to identify the changes being made

Response Parameters#

Parameter
Type Description
id Number id of newly created changeset
branch_id Number ID of the Branch this change affected (destination branch)
user_id Number ID of Admin user who made the copy. This will always be 0 when done though the API
dtstamp Unix Timestamp Timestamp the copy was made
notes String Notes from the branch copy
tags Array Array of all the tags associated with the changeset being copied
formatted_tags String Individual tags associated with the changeset

Example Request#

{
    "Store_code": "beta",
    "Function": "Branch_Copy",
    "Source_Branch_ID": "5",
    "Destination_Branch_ID": "5",
    "Source_Changeset_ID": "29",
    "Notes": "Pushing Storefront changes to production"
}

Example Response#

{
    "success": 1,
    "data": {
        "id": 31,
        "branch_id": 5,
        "user_id": 0,
        "dtstamp": 1596579069,
        "notes": "Pushing Storefront changes to production",
        "tags": [],
        "formatted_tags": ""
    }
}