REST API for Jira Cloud

This is the reference documentation for the AssertThat - BDD & Cucumber for Jira REST API. This API is the primary way to get and modify data in the plugin, whether you are developing an app or any other integration. Use it to interact with the plugin for entities, such as features, reports, scenarios and more.

Authentication: All endpoints use basic auth. Refer toAssertThat Configuration & Enable for project to generate API access keys.

Base cloud URL: https://bdd.assertthat.app

Postman collection and environment with example requests is available for download below.

 

API Requests

Downloading features

GET /rest/api/1/project/{projectId}/features

Parameters

Name

Required

Type

Description

Name

Required

Type

Description

mode

No

String

One of: automated, manual, both

jql

No

String

JQL filter for scenarios linked to certain issues

numbered

No

Boolean

Whether to prepend ordinal to the feature name

tags

No

String

Tag expression to filter features/ scenarios

Uploading report

POST/rest/api/1/project/{projectId}/report

Parameters

Name

Required

Type

Description

Name

Required

Type

Description

runName

No

String

The name of the run. Default Test run dd MMM yyyy HH:mm:ss

metadata

No

Json string

Metadata json

runId

No

Long

If submitting new report set to -1. If adding test results to existing should be set to the value return when submitting new report.

form-data: file

Yes

Json file

Cucumber json report file

type

No

String

One of: cucumber, karate. Defaults to cucumber.

customRunId

No

String

Overrides runId. Should be unique between test runs and same for aggregating results into same execution.

jql

No

String

JQL filter for updating status of scenarios linked to certain issues

Updating scenario status

PUT /rest/api/1/project/{projectId}/scenario/status

Body:

{ "featureName": "Feature name", "scenarioName": "Scenario Name", "issueKey": "XXX-123", "comment": "comment", "status": "NOT_RUN | PASSED | FAILED | IN_PROGRESS" }

Get test runs

GET /rest/api/1/project/{projectId}/report/runs

Parameters

Name

Required

Type

Description

Name

Required

Type

Description

length

No

int

Number of records to return. Default is 10

start

No

int

Start index. Default is 0

Upload feature

POST /rest/api/1/project/{projectId}/feature

Name

Required

Type

Description

Name

Required

Type

Description

override

No

boolean

Whether to override feature if exists with same name

form-data: file

Yes

file

Feature file to upload

Get scenarios report

GET /rest/api/1/project/{projectId}/scenarios/report

Parameters

Name

Required

Type

Description

Name

Required

Type

Description

length

No

int

Number of records to return. Default is 10

start

No

int

Start index. Default is 0

Upload scenario executions

POST /rest/api/1/project/{projectId}/scenarios/execution

Body:

 {             "scenarioName": "Exanple scenario",             "featureName": "Example feature",             "executions": [                 {                     "id": 100,                     "status": "PASSED",                     "issueKey": "DEMO-1",                     "comment": "Example comment",                     "userId": 10000,                     "userEmail": "admin@admin.com",                     "timestamp": 1624908743000                 },                 {                     "id": 101,                     "status": "IN_PROGRESS",                     "issueKey": "DEMO-1",                     "comment": "Example comment 2",                     "userId": 10000,                     "userEmail": "admin@admin.com",                     "timestamp": 1624908812000                 }             ]         }

Delete feature

DELETE /rest/api/1/project/{projectId}/feature/delete

When using the deletion API, you can provide either a .feature file or a feature name as input. However, if both are provided, the API will prioritize the feature name, and the .feature file will be disregarded. This ensures that the feature name is always used if specified, regardless of whether a file is also provided.

Name

Required

Type

Description

Name

Required

Type

Description

name

No

string

Feature name to delete (ensure the value is URL -encoded)

form-data: file

No

file

Feature to delete