- Get started
- About
- Glossary
- Create a company-managed project
- Jira permissions
- First steps
- Configuration
- Migration to Cloud
- Use cases
- User's guide
- Project view
- Navigation
- Relations
- Requirement
- Test Case
- Test Plan
- Test Execution
- Defect
- REST API
- REST API
- Authentication
- Test Key
- Jira REST API
- Requirements
- Test Case
- Test Plan
- Test Execution
- Test Case Execution
- Defects
- Tree Structure
- Example of use
Example of use
How to create a new Test Case via API v1
{
"projectKey": "TEMP",
"summary": "Create TC Edit with ID",
"description": "desc",
"preconditions": "pre1",
"labels": [
"Frontend",
"Backend"
],
"assigneeId": "{{assigneeId}}",
"components": [
{
"id": "10000"
}
],
"versions": [
{
"id": "10000"
}
],
"environment": "dhdh",
"priority": {
"id": 1
},
"coveredRequirements": [
"{{ReqTestKey}}"
],
"timeEstimate": 3,
"testKey": "newtestkeyd",
"steps": [
[
{
"value": "step1"
},
{
"value": "step2"
},
{
"value": "step3"
}
],
[
{
"groupName": "stepgroup"
}
]
],
"links": [
{
"testKey": "newtestkeyd"
}
]
}
How to create a new Test Case via API v2
{
"projectKey": "TEMP",
"summary": "Create TC" ,
"description": "content of description",
"preconditions": "pre1",
"labels": ["Frontend", "Backend"],
"components": [
{"name": "ComponentName"}
],
"versions": [
{"name": "VersionName"}
],
"environment": "rtm1",
"priority": {
"name": "Lowest"
},
"coveredRequirements": [
{
"testKey": "{{ReqTestKey}}"
}
],
"parentTestKey": "{{TestCasesParentFolder}}",
"stepGroups": [
{
"name": "name of group",
"steps": [
{
"stepColumns": [
{
"ordinal": "1",
"value": "content of column 1"
},
{
"ordinal": "2",
"value": "content of column 2"
},
{
"ordinal": "3",
"value": "content of column 3"
}
],
"stepAttachments": [
{
"attachmentId": idAttachment
}
]
}
]
}
]
}
The ordinal's
value determines the step’s order. You can decide how to organize Test steps by setting up own values.
It’s also possible to add an attachment to the Test Case step. Simply enter an attachment’s ID in stepAttachments
.
How to set up links
Operation SET - generates an exact set of links indicated in the payload
{
"coveredRequirements": {
"set": [
{
"testKey": "{{ReqTestKey2}}"
}
]
}
}
Operation ADD - adds links indicated in the payload
{
"coveredRequirements": {
"add": [
{
"testKey": "{{ReqTestKey2}}"
}
]
}
}
Operation REMOVE - deletes links indicated in the payload
{
"coveredRequirements": {
"remove": [
{
"testKey": "{{ReqTestKey2}}"
}
]
}
}
In case of leaving the SET/ADD/REMOVE playload empty, the set operation will be applied. It means that:
- links which are not defined in the new playload will be removed
- existing links will stay the same
- new links will be added.
How to set up a Components field
It’s possible to set up the Components using their id as well as name:
"components": [
{"name": "{{ComponentName}}"}
],
"components": [
{"id": "{{ComponentId}}"}
],
How to set up a Priority field
It’s possible to set up the Priority using their id as well as name:
"priority": [
{"name": "{{PriorityName}}"}
],
"priority": [
{"id": "{{PriorityId}}"}
],
How to set up Test Steps via API v1
Rows are defined as a list of the objects: {'value':'cellValue'}
.
Groups are defined as objects with the attribute “groupName”: {'groupName':'cellValue'}
.
"steps": [
[{"value": "row1_cell_1"}, {"value": "row1_cell_2"}, {"value": "row1_cell_3"}],
[{"groupName": "updatestepgroup"}],
[{"value": "row1_cell_1"}, {"value": "row1_cell_2"}, {"value": "row1_cell_3"}],
]
How to set up Test Steps via API v2
"stepGroups": [
{
"name": "name of group",
"steps": [
{
"stepColumns": [
{
"ordinal": "1",
"value": "content of column 1"
}, {
"ordinal": "2",
"value": "content of column 2"
}, {
"ordinal": "3",
"value": "content of column 3"
}
]
}
]
}
]
ordinal's
value determines the step’s order. You can decide how to organize Test steps by setting up own values.