Campaign Test Plan Items

This chapter focuses on services for the campaign test plan items. A campaign test plan item represents a test case that has been planned in a campaign test plan. It belongs to a campaign and binds together the test case to execute with a dataset (optional) and an assigned user (optional).

Get campaign test plan item

A GET to /campaign-test-plan-items/{id} returns the campaign test plan item with the given id.

Path parameters

Table 1. /api/rest/latest/campaign-test-plan-items/{id}
Parameter Description

id

the id of the campaign test plan item

HTTP request

GET /api/rest/latest/campaign-test-plan-items/89 HTTP/1.1
Accept: application/json
Host: localhost:8080

Request parameters

Parameter Description

fields

which fields of the elements should be returned (optional)

HTTP response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 1304

{
  "_type" : "campaign-test-plan-item",
  "id" : 89,
  "referenced_test_case" : {
    "_type" : "test-case",
    "id" : 12,
    "name" : "referenced test case 12",
    "reference" : "",
    "_links" : {
      "self" : {
        "href" : "http://localhost:8080/api/rest/latest/test-cases/12"
      }
    }
  },
  "referenced_dataset" : {
    "_type" : "dataset",
    "id" : 9,
    "name" : "referenced dataset 9",
    "_links" : {
      "self" : {
        "href" : "http://localhost:8080/api/rest/latest/datasets/9"
      }
    }
  },
  "assigned_to" : "User-1",
  "campaign" : {
    "_type" : "campaign",
    "id" : 8,
    "name" : "sample campaign 8",
    "reference" : "SAMP_CAMP_8",
    "_links" : {
      "self" : {
        "href" : "http://localhost:8080/api/rest/latest/campaigns/8"
      }
    }
  },
  "_links" : {
    "self" : {
      "href" : "http://localhost:8080/api/rest/latest/campaign-test-plan-items/89"
    },
    "project" : {
      "href" : "http://localhost:8080/api/rest/latest/projects/7"
    },
    "test-case" : {
      "href" : "http://localhost:8080/api/rest/latest/test-cases/12"
    },
    "dataset" : {
      "href" : "http://localhost:8080/api/rest/latest/datasets/9"
    },
    "campaign" : {
      "href" : "http://localhost:8080/api/rest/latest/campaigns/8"
    }
  }
}

Response fields

Path Type Description

_type

String

the type of the entity

id

Number

the id of this campaign test plan item

referenced_test_case

Object

the test case associated with this campaign test plan item

referenced_dataset

Object

the dataset associated with this campaign test plan item

assigned_to

String

the user assigned to this campaign test plan item

campaign

Object

the campaign this campaign test plan item belongs to

_links

Object

related links

Relation Description

self

link to this campaign test plan item

project

link to the project of this item

test-case

link to the test case referenced by this item

dataset

link to the dataset referenced by this item

campaign

link to the campaign this item belongs to

Create campaign test plan item

A POST to /campaign/{id}/test-plan creates a new entry in the test plan of the campaign with the given id. The entry must reference a test case, and optionally for which dataset and which assignee. If specified, the dataset must belong to the referenced Test Case. The dataset and/or assignee may be undefined or null if you don’t want to set them yet.

Path parameters

Table 1. /api/rest/latest/campaign/{id}/test-plan
Parameter Description

id

the id of the campaign

HTTP request

POST /api/rest/latest/campaign/45/test-plan HTTP/1.1
Accept: application/json
Content-Length: 193
Content-Type: application/json
Host: localhost:8080

{
  "_type" : "campaign-test-plan-item",
  "test_case" : {
    "_type" : "test-case",
    "id" : 238
  },
  "dataset" : {
    "_type" : "dataset",
    "id" : 6
  },
  "assigned_to" : "User-1"
}

Request fields

Path Type Description

_type

String

the type of the entity

test_case

Object

the test case to include in the test plan (as described below)

test_case._type

String

the type of the entity (always 'test-case')

test_case.id

Number

the id of the test case

dataset

Object

the dataset to be used when the test case will be executed (optional)

dataset._type

String

the type of the entity (always 'dataset')

dataset.id

Number

the id of the dataset. Remember that the dataset must belong to the planned test case.

assigned_to

String

the username of the user assigned to this test case (optional)

HTTP response

HTTP/1.1 201 Created
Content-Length: 1292
Content-Type: application/json;charset=UTF-8

{
  "_type" : "campaign-test-plan-item",
  "id" : 15,
  "referenced_test_case" : {
    "_type" : "test-case",
    "id" : 238,
    "name" : "Test-Case 1",
    "reference" : "Ref Test-Case 1",
    "_links" : {
      "self" : {
        "href" : "http://localhost:8080/api/rest/latest/test-cases/238"
      }
    }
  },
  "referenced_dataset" : {
    "_type" : "dataset",
    "id" : 6,
    "name" : "JD-1",
    "_links" : {
      "self" : {
        "href" : "http://localhost:8080/api/rest/latest/datasets/6"
      }
    }
  },
  "assigned_to" : "User-1",
  "campaign" : {
    "_type" : "campaign",
    "id" : 45,
    "name" : "AKM - Campaign Test",
    "reference" : "ABCD",
    "_links" : {
      "self" : {
        "href" : "http://localhost:8080/api/rest/latest/campaigns/45"
      }
    }
  },
  "_links" : {
    "self" : {
      "href" : "http://localhost:8080/api/rest/latest/campaign-test-plan-items/15"
    },
    "project" : {
      "href" : "http://localhost:8080/api/rest/latest/projects/2"
    },
    "test-case" : {
      "href" : "http://localhost:8080/api/rest/latest/test-cases/238"
    },
    "dataset" : {
      "href" : "http://localhost:8080/api/rest/latest/datasets/6"
    },
    "campaign" : {
      "href" : "http://localhost:8080/api/rest/latest/campaigns/45"
    }
  }
}

Modify campaign test plan item

A Patch to /campaign-test-plan-items/{id} modifies the campaign test plan item with the given id. You can modify dataset or assigned_to or both. A property left absent from the json payload will not be altered, if present with a null value they will be reset. You cannot change the planned test case.

Path parameters

Table 1. /api/rest/latest/campaign-test-plan-items/{id}
Parameter Description

id

the id of the campaign test plan item

HTTP request

PATCH /api/rest/latest/campaign-test-plan-items/13 HTTP/1.1
Accept: application/json
Content-Length: 128
Content-Type: application/json
Host: localhost:8080

{
  "_type" : "campaign-test-plan-item",
  "dataset" : {
    "_type" : "dataset",
    "id" : 6
  },
  "assigned_to" : "User-1"
}

Request fields

Path Type Description

_type

String

the type of the entity

dataset

Object

the dataset to use when the test case is executed (optional). You can remove the dataset by setting this to null.

dataset._type

String

the type of the entity ('dataset')

dataset.id

Number

the id of this dataset

assigned_to

String

the username of the user assigned to this test (optional). You can assign this test to nobody by setting this to null.

HTTP response

HTTP/1.1 200 OK
Content-Length: 1292
Content-Type: application/json;charset=UTF-8

{
  "_type" : "campaign-test-plan-item",
  "id" : 13,
  "referenced_test_case" : {
    "_type" : "test-case",
    "id" : 238,
    "name" : "Test-Case 1",
    "reference" : "Ref Test-Case 1",
    "_links" : {
      "self" : {
        "href" : "http://localhost:8080/api/rest/latest/test-cases/238"
      }
    }
  },
  "referenced_dataset" : {
    "_type" : "dataset",
    "id" : 6,
    "name" : "JD-1",
    "_links" : {
      "self" : {
        "href" : "http://localhost:8080/api/rest/latest/datasets/6"
      }
    }
  },
  "assigned_to" : "User-1",
  "campaign" : {
    "_type" : "campaign",
    "id" : 45,
    "name" : "AKM - Campaign Test",
    "reference" : "ABCD",
    "_links" : {
      "self" : {
        "href" : "http://localhost:8080/api/rest/latest/campaigns/45"
      }
    }
  },
  "_links" : {
    "self" : {
      "href" : "http://localhost:8080/api/rest/latest/campaign-test-plan-items/13"
    },
    "project" : {
      "href" : "http://localhost:8080/api/rest/latest/projects/2"
    },
    "test-case" : {
      "href" : "http://localhost:8080/api/rest/latest/test-cases/238"
    },
    "dataset" : {
      "href" : "http://localhost:8080/api/rest/latest/datasets/6"
    },
    "campaign" : {
      "href" : "http://localhost:8080/api/rest/latest/campaigns/45"
    }
  }
}

Delete campaign test plan item

A DELETE to /campaign-test-plan-items/{testPlanItemsIds} deletes one or several campaign test plan items with the given id(s).

Path parameters

Table 1. /api/rest/latest/campaign-test-plan-items/{testPlanItemsIds}
Parameter Description

testPlanItemsIds

the list of ids of the campaign test plan items

HTTP request

DELETE /api/rest/latest/campaign-test-plan-items/44 HTTP/1.1
Accept: application/json
Content-Type: application/json
Host: localhost:8080