Manage Tests and Build Problems
This article lists REST API requests concerning tests and build problems.
To list build problems, use:
GET/app/rest/problemOccurrences?locator=<problemOccurrenceLocator>
The request responds with Problems which contains instances of a Problem entity.
problemOccurrenceLocator
is typed as ProblemOccurrenceLocator. For example, to get build problems for a build with the ID 999
, use:
GET/app/rest/problemOccurrences?locator=build:(id:999)
To list specific tests, use:
GET/app/rest/testOccurrences?locator=<testOccurrenceLocator>
The request responds with Tests which contains instances of a Test entity.
testOccurrenceLocator
is typed as TestOccurrenceLocator.
Some supported locator dimensions:
build:(<buildLocator>)
— test run in the build found withbuildLocator
(BuildLocator).build:(<buildLocator>),muted:true
— failed tests which were muted in the build.test:(<testLocator>)
— instances of the test found withtestLocator
(TestLocator).currentlyFailing:true,affectedProject:<projectLocator>
— tests currently failing under the project specified withprojectLocator
(recursively).projectLocator
is typed as ProjectLocator.currentlyMuted:true,affectedProject:<projectLocator>
— tests currently muted under the project specified (recursively). See also the project's Muted Problems tab.includePersonal:true
— include tests from personal builds.
For example, to list all tests for a given build with the ID 999
use:
GET/app/rest/testOccurrences?locator=build:(id:999)
To get the test history for a given test named MyTest
, use:
GET/app/rest/testOccurrences?locator=test:(name:MyTest)
To list a build's tests which were muted during the build run, use:
GET/app/rest/testOccurrences?locator=build:(id:999),muted:true
To list currently muted tests (muted since the failure), use:
GET/app/rest/testOccurrences?locator=build:(id:999),currentlyMuted:true
To retrieve a list of all muted entities, use:
GET/app/rest/mutes
The request responds with Mutes which contains instances of a Mute entity.
To get specific mutes, use:
GET/app/rest/mutes?locator=<muteLocator>
muteLocator
is typed as MuteLocator. For example, to locate all muted tests under the MyProject
project, use:
GET/app/rest/mutes?locator=project:(id:MyProject)
To mute a given test or a build problem, POST a Mute to:
POST/app/rest/mutes
Example payload:
<mute>
<scope><project id="<projectID>"/></scope>
<target><tests><test name="<testName>"/></tests></target>
<resolution type="whenFixed"/>
</mute>
{
"scope" : {
"project" : {
"id" : "id"
}
},
"target" : {
"tests" : {
"test" : [
{
"name" : "name"
}
]
},
},
"resolution" : {
"type" : "whenFixed"
}
}
To unmute a test or build problem, use:
DELETE/app/rest/mutes/<muteLocator>
Thanks for your feedback!