ts.dod.new_version

Create a new version of a DoD policy with updated conditions.

Create a new version of a DoD policy with updated conditions.

Requires authentication

Description

Creates a new version of an existing DoD policy. The old version is archived and a predecessor link is established. Existing endorsements on the old version are superseded – team members must re-endorse the new version.

Use this when conditions need to change (conditions cannot be modified via ts.dod.update). Templates cannot be versioned directly – fork them first with ts.dod.create using origin “derived”.

Parameters

NameTypeRequiredDefaultDescription
idstringYesID of the policy to create a new version of
namestringName for the new version (defaults to source name)
descriptionstringDescription (defaults to source description)
conditionsarrayArray of condition objects with id, type, label, params, required
strictnessstringStrictness: all (default), n_of
quorumintegerRequired count when strictness is n_of
metadataobjectArbitrary key-value pairs

Response

Returns the new policy version.

{
  "conditions": [
    "..."
  ],
  "id": "dod_new123abc",
  "name": "Review Policy v2",
  "predecessor_id": "dod_a1b2c3d4e5f6",
  "status": "active",
  "version": 2
}

Errors

CodeDescription
not_authenticatedNo active login for this session
invalid_inputPolicy ID is required
not_foundSource policy not found
invalid_inputCannot version a template policy

Examples

Update conditions on a policy

Create v2 of a policy with an additional peer review condition.

Request:

{
  "conditions": [
    {
      "id": "cond_01",
      "label": "Comment needed",
      "params": {
        "min_comments": 1
      },
      "required": true,
      "type": "comment_required"
    },
    {
      "id": "cond_02",
      "label": "Peer review",
      "params": {
        "min_reviewers": 1
      },
      "required": true,
      "type": "peer_review"
    }
  ],
  "id": "dod_a1b2c3d4e5f6",
  "name": "Review Policy v2"
}

Response:

{
  "id": "dod_new123abc",
  "name": "Review Policy v2",
  "predecessor_id": "dod_a1b2c3d4e5f6",
  "status": "active",
  "version": 2
}