This is the reference section of the Crucible REST API.
For information about Crucible Plugin Development, visit the Development Hub.
This documentation was automatically generated from the WADL.
Please have a look at python examples that demonstrate the capabilities of Fisheye & Crucible REST API: bitbucket.org/atlassian/fecru-rest-examples/src
Fisheye uses paging to conserve server resources and limit response size for resources that return potentially large
collections of items. A request to a paged API will result in a values
array wrapped in a JSON object
with some paging metadata, like this:
{
"start": 3,
"size": 3,
"limit": 100,
"lastPage": true,
"values": [
{ /* result 0 */ },
{ /* result 1 */ },
{ /* result 2 */ }
]
}
Clients can use the limit
and start
query parameters to retrieve the desired number of
results.
The limit
parameter indicates how many results to return per page. Most APIs default to returning
100
if the limit is left unspecified. A resource can have a hard limit. It's always best practice to
check the limit
attribute on the response to see what limit has been applied.
The request to get a page with desired size should look like this:
http://host:port/context/rest/api/api-version/path/to/resource?limit={desired size of page}
For example:
http://fecru.atlassian.com/rest/api/1.0/rest-service-fecru/users?limit=50
The start
parameter indicates which item should be used as the first item in the page of results. All
paged responses contain a lastPage
attribute indicating whether another page of items exists.
If a paged response has a property lastPage
set to false
, the next page start should be calculated
by adding current page start
and size
.
The request to get a subsequent page should look like this:
http://host:port/context/path/to/resource?start={start of last page}+{size of last page}&limit={desired size of page}
For example:
http://fecru.atlassian.com/rest/api/1.0/rest-service-fecru/users?size=50&limit=50
Resource providing information about available reviewers.
parameter | value | description |
---|---|---|
reviewId |
review id determining allowed reviewers |
Get review participants (users and groups) which are allowed to participate in given review and match a query.
parameter | value | description |
---|---|---|
q |
the query string to search groups containing the string in the name, and to search users containing the string in username, name and email |
|
includeUsers |
Default: true |
true if it should search users by username, displayname and email |
includeGroups |
Default: true |
true if it should search groups by name |
limit |
Default: 25 |
the maximum number of results to be returned |
available response representations:
parameter | value | description |
---|---|---|
groupName |
group name whose members should be returned, if the group doesn't exists, empty results will be returned |
|
reviewId |
review id determining allowed reviewers |
Get members of groups being allowed to participate in given review. Note that this path doesn't follow the REST standard, like {reviewId}/groups/{groupName}/members, because there is a chance to have ambiguous path for different resources. For example if the group is 'department/members' and you want to GET this entity, you call GET {reviewId}/groups/department/members but this could be treated as GET entity of group 'department/members' or GET members of group 'department'
parameter | value | description |
---|---|---|
start |
Default: 0 |
the number of first result to be returned |
limit |
Default: 50 |
the maximum number of results to be returned |
available response representations:
This resource offers the ability for client applications to authenticate with Crucible and use the returned session identifier to make further calls without the need to send the caller's username and password every time.
The received token should be used as a FEAUTH query parameter for subsequent REST requests.
Usage of this resource is not required, as Crucible's REST API also supports basic HTTP authentication whereby the caller embeds the username and password in the HTTP request headers of every call, making the process completely stateless.
See https://developer.atlassian.com/display/FECRUDEV/Authenticating+REST+Requests for more details.Deprecated since FishEye 3.5.0 for removal in 4.0. Use POST /rest-service-fecru/auth/login instead.
Get the user authentication token.acceptable request representations:
parameter | value | description |
---|---|---|
userName |
the username of the user to get the token for |
|
password |
the password for the user to get the token for |
available response representations:
Deprecated since FishEye 3.5.0 for removal in 4.0. Use POST /rest-service-fecru/auth/login instead.
Get the user authentication token.parameter | value | description |
---|---|---|
userName |
the username of the user to get the token for |
|
password |
the password for the user to get the token for |
available response representations:
Endpoint for accessing review activity items. List of supported activity items: {@link com.atlassian.fecru.activityitem.ActivityItemDataService.Type} {@see ActivityItemDataService}
parameter | value | description |
---|---|---|
permId |
Get a list of all the users. You can also ask for a set of users.
parameter | value | description |
---|---|---|
username |
a username (or a few) to limit the number of returned entries. It will return only existing users. |
available response representations:
parameter | value | description |
---|---|---|
repository |
the key of the repository |
|
username |
the name of the committer |
Returns the user details of the user mapped to a committer in a repository.
available response representations:
parameter | value | description |
---|---|---|
username |
the username of the user |
Returns the user's profile details.
available response representations:
Provides an API for searching reviews.
Search for reviews where the name, description, state or permaId contain the specified term.
parameter | value | description |
---|---|---|
term |
a search term. |
|
maxReturn |
the maximum number of reviews to return. |
available response representations:
Get a list of all reviews that have been linked to the specified Jira issue key.
parameter | value | description |
---|---|---|
jiraKey |
a Jira issue key (e.g. "FOO-3453") |
|
maxReturn |
the maximum number of reviews to return. |
available response representations:
Get all reviews as a list of ReviewData
structures. Note
that this may return a lot of data, so using
/reviews-v1/filter/<filter>
is usually better.
The state parameter is a comma separated list of state names from the
set Draft
, Approval
, Review
,
Summarize
, Closed
, Dead
,
Rejected
, Unknown
.
parameter | value | description |
---|---|---|
state |
only return reviews that are in these states. |
available response representations:
Create a review from the given createReview element.
The sub-elements of the createReview element determine what type of review is created and how it is populated. The following rules govern which sub-elemnts can be present and how they are used in the review creation process
The response includes the Location
header that contains the URL of the newly created entity.
acceptable request representations:
available response representations:
parameter | value | description |
---|---|---|
id |
the review perma id |
|
cId |
the comment perma id |
Gets the given comment.
parameter | value | description |
---|---|---|
render |
Default: false |
true if the wiki text should be rendered into html, into the field <messageAsHtml>. |
available response representations:
Updates the comment given by the perma id to the new comment posted.
acceptable request representations:
Deletes the given comment.
parameter | value | description |
---|---|---|
id |
the review perma id to add the file |
Adds a file to the review, optionally diff'ed to a second file.
In contrast to a patch, files can be either binary or text. Depending on the filetype, size and contents, Crucible may be able to display either parts, or the entire file in the review. It is possible to upload two versions of the file, in which case Crucible will display a diff and report that the file was modified. When only a single file is uploaded, Crucible treats the file as newly added.
This action returns the ReviewData document on success.
This resources uses multipart form-data to receive the file(s), character set indication and optional comments (it does not expect an XML document with embedded files, as that would require the client to first encode the files in Base64). Making a multipart form-data request can be done manually, but you will probably want to use a library.
During testing it is convenient to let your browser generate the requests using the test html form below:
<html> <head><title>Rest File Upload Test</title></head> <body> <form action="http://localhost:8060/rest-service/reviews-v1/CR-4/addFile" enctype="multipart/form-data" method="POST"> <table> <tr> <td>File (required):</td> <td><input name="file" type="file"/></td> </tr> <tr> <td>Diff to (optional):</td> <td><input name="diffFile" type="file"/></td> </tr> <tr> <td>Character Set (optional):</td> <td><input name="charset" type="text" value="UTF-8"/></td> </tr> <tr> <td>Comments (optional):</td> <td><input type="text" name="comments"/></td> </tr> <tr><td><input type="submit" value="Upload"/></td></tr> </table> </form> </body> </html>
available response representations:
parameter | value | description |
---|---|---|
version |
a metrics version. |
Retrieves all reviews that are in one of the the specified states. For each review all details are included (review items + comments). The wiki rendered comments will be available via the <messageAsHtml> element
parameter | value | description |
---|---|---|
state |
the review states to match. |
available response representations:
parameter | value | description |
---|---|---|
filter |
a predefined filter type. Available filter names are:
|
parameter | value | description |
---|---|---|
filter |
a predefined filter type. Available filter names are:
|
Returns all reviews that satisfy the specified filter parameters and are accessible under the provided credentials.
To ignore a property, omit it from the query string.parameter | value | description |
---|---|---|
title |
a string that will be searched for in review titles. |
|
author |
reviews authored by this user. |
|
moderator |
reviews moderated by this user. |
|
creator |
reviews created by this user. |
|
states |
comma-separated list of amy of the following strings: (Draft, Approval, Review, Summarize, Closed, Dead, Rejected, Unknown). |
|
reviewer |
reviews reviewed by this user. |
|
orRoles |
whether the value of |
|
complete |
reviews that the specified reviewer has completed. |
|
allReviewersComplete |
Reviews that all reviewers have completed. |
|
project |
reviews for the specified project. |
|
fromDate |
reviews with last activity date after the specified timestamp, in milliseconds. Inclusive. |
|
toDate |
reviews with last activity date before the specified timestamp, in milliseconds. Inclusive. |
available response representations:
This method should no longer be used, as it uses a POST for a read-only retrieval operation and is provided for backward compatibility only.
Do a GET instead.
acceptable request representations:
available response representations:
Returns all (detailed) information of all reviews that satisfy the specified filter parameters and are accessible under the provided credentials.
To ignore a property, omit it from the query string.parameter | value | description |
---|---|---|
title |
a string that will be searched for in review titles. |
|
author |
reviews authored by this user. |
|
moderator |
reviews moderated by this user. |
|
creator |
reviews created by this user. |
|
states |
comma-separated list of amy of the following strings: (Draft, Approval, Review, Summarize, Closed, Dead, Rejected, Unknown). |
|
reviewer |
reviews reviewed by this user. |
|
orRoles |
whether the value of |
|
complete |
reviews that the specified reviewer has completed. |
|
allReviewersComplete |
Reviews that all reviewers have completed. |
|
project |
reviews for the specified project. |
|
fromDate |
reviews with last activity date after the specified timestamp, in milliseconds. Inclusive. |
|
toDate |
reviews with last activity date before the specified timestamp, in milliseconds. Inclusive. |
available response representations:
parameter | value | description |
---|---|---|
repository |
the key of the repository to search for file |
Return a list of Reviews which include a particular file.
The path parameter must be the full path name of a file in repository, with no leading slash.
parameter | value | description |
---|---|---|
path |
path to find in reviews |
available response representations:
parameter | value | description |
---|---|---|
repository |
the key of the repository to search for file. |
Return a list of Reviews which include a particular file.
The path parameter must be the full path name of a file in repository, with no leading slash.
For each review all details are included (review items + comments).
parameter | value | description |
---|---|---|
path |
path to find in reviews. |
available response representations:
parameter | value | description |
---|---|---|
id |
the permId of the review to delete (e.g. "CR-45"). |
Get a single review by its permId (e.g. "CR-45"). If the review does not exist, a 404 is returned.
The moderator element may not exist if the review does not have a Moderator.available response representations:
Permanently deletes the specified review. The review must have been abandoned.
parameter | value | description |
---|---|---|
id |
the permId of the review (e.g. "CR-45"). |
parameter | value | description |
---|---|---|
id |
the permId of the a review (e.g. "CR-45"). |
Get a list of the actions which the current user is allowed to perform on the review.
This shows actions the user has permission to perform - the review may not be in a suitable state for all these actions to be performed.
available response representations:
parameter | value | description |
---|---|---|
id |
the permId of the a review (e.g. "CR-45"). |
parameter | value | description |
---|---|---|
id |
the perm id of the review to add the changeset to |
parameter | value | description |
---|---|---|
id |
the review id to get the patches for |
Add the revisions in a patch to an existing review.
If the anchor field is filled Crucible will attempt to anchor the patch to the specified repository/path
If the source field is filled Crucible will attempt to add the patch to the existing patch with the given source name. Both patches need to be anchored to the same repository. Use GET reviews-v1/{id}/patch to get a list of valid sources.
acceptable request representations:
available response representations:
parameter | value | description |
---|---|---|
patchId |
the id of the patch (as returned by the '{id}/patch' resource) |
|
id |
the permaId of the review |
parameter | value | description |
---|---|---|
id |
Old, non-restful name. Kept for backwards compatibility. Exactly the same as POSTing to /{id}/patch
acceptable request representations:
available response representations:
parameter | value | description |
---|---|---|
id |
the id of the review to add to |
Get a list of reviewers in the review given by the permaid id.
available response representations:
parameter | value | description |
---|---|---|
id |
the review perma id to retrieve reviewers |
parameter | value | description |
---|---|---|
id |
the review perma id to retrieve reviewers |
parameter | value | description |
---|---|---|
id |
the perma id of the review |
|
username |
the name of the reviewer. |
Removes the reviewer from the review.
parameter | value | description |
---|---|---|
id |
the id of the review (e.g. "CR-362"). |
Returns a list of all the items in a review.
available response representations:
Add the changes between two files in a fisheye repository to the review.
This call includes the Location
repsonse header that
contains the URL of the newly created entity.
acceptable request representations:
available response representations:
parameter | value | description |
---|---|---|
id |
the id of the review (e.g. "CR-362"). |
Adds a review item for each of the supplied crucibleRevisionData elements.
Provide a list of crucibleRevisionData elements, each one containing the desired shape of the review item. If a crucibleRevisionData element contains a path that already exists (i.e., an existing review item with the same path is in the review), then the crucibleRevisionData element given here will merge the revisions with the existing review item revisions instead of creating a new review item.
acceptable request representations:
available response representations:
parameter | value | description |
---|---|---|
id |
the id of the review (e.g. "CR-362"). |
Adds the given review item to the review. This will always create a new review item, even if there is an existing one with the same data in the review (in which case the existing item will be replaced).
The response includes the Location
HTTP header.
acceptable request representations:
available response representations:
parameter | value | description |
---|---|---|
riId |
a valid review item id (e.g. "CFR-5622"). |
|
id |
a valid review id (e.g. "CR-345"). |
Sets the review item specified by itemId with the given reviewItem. The old review item is discarded. Can only perform this operation if the old review item specified by itemId can be deleted. The old review item's permId is not changed.
acceptable request representations:
available response representations:
parameter | value | description |
---|---|---|
riId |
the id of the review item from which to remove the list of revisions (e.g. "CFR-5622"). |
|
id |
the PermId of the review to remove the item from (e.g. "CR-345"). |
parameter | value | description |
---|---|---|
rev |
a list of revisions to remove. If the revision does not exist in the review item, it is ignored. |
Adds the given list of revisions to the supplied review item, merging if required. For example, if the review
item for a.txt
contains revisions 3 to 6, and if:
a.txt
will have revisions 3--4--5--6
a.txt
will have revisions 2--3--6--7
a.txt
will have revisions 2--3--6
a.txt
will have revisions 3--6--7
a.txt
will have revisions 2--3--4--6
a.txt
will have revisions 3--4--6--7
available response representations:
Removes the revisions given from the review item in the review specified by the id. If the review item has no more revisions left, it is automatically deleted.
parameter | value | description |
---|---|---|
riId |
review item id (e.g. "CFR-6312"). |
|
id |
review id (e.g. "CR-345"). |
parameter | value | description |
---|---|---|
id |
the review perma-id |
Return all the comments visible to the requesting user for the review.
parameter | value | description |
---|---|---|
render |
Default: false |
indicate whether to render the wiki text in the returned comments. If set to "true", the comments will contain a <messageAsHtml> element containing the wiki rendered html. |
available response representations:
Add a general comment to the review.
acceptable request representations:
available response representations:
parameter | value | description |
---|---|---|
id |
review perma-id |
parameter | value | description |
---|---|---|
render |
Default: false |
indicate whether to render the wiki text in the returned comments. If set to "true", the comments will contain a <messageAsHtml> element containing the wiki rendered html. |
available response representations:
parameter | value | description |
---|---|---|
id |
review perma-id |
parameter | value | description |
---|---|---|
render |
Default: false |
indicate whether to render the wiki text in the returned comments. If set to "true", the comments will contain a <messageAsHtml> element containing the wiki rendered html. |
available response representations:
parameter | value | description |
---|---|---|
riId |
the review item id. |
|
id |
the review perma id |
parameter | value | description |
---|---|---|
render |
Default: false |
indicate whether to render the wiki text in the returned comments. If set to "true", the comments will contain a <messageAsHtml> element containing the wiki rendered html. |
available response representations:
parameter | value | description |
---|---|---|
id |
the review perma-id (e.g. "CR-45"). |
|
cId |
the comment to reply to |
Gets the replies to the given comment.
parameter | value | description |
---|---|---|
render |
Default: false |
true if the comments should also be rendered into html, into the element <messageAsHtml> |
available response representations:
Adds a reply to the given comment. This call includes the Location
repsonse header that
contains the URL of the newly created entity.
acceptable request representations:
available response representations:
parameter | value | description |
---|---|---|
id |
the review perma-id (e.g. "CR-45"). |
parameter | value | description |
---|---|---|
id |
the review perma id |
|
cId |
the comment perma id. |
parameter | value | description |
---|---|---|
id |
the review perma id for the comment |
|
cId |
the comment perma id |
parameter | value | description |
---|---|---|
id |
The review perma id |
|
rId |
the perma id of the reply to delete |
|
cId |
the reply's parent comment perma id |
parameter | value | description |
---|---|---|
id |
the review perma id to look for draft comments |
Publishes all the draft comments of the current user.
parameter | value | description |
---|---|---|
id |
the review perma id |
|
cId |
the comment perma id |
publishes the given draft comment.
parameter | value | description |
---|---|---|
id |
the review perma id |
Completes the review for the current user
parameter | value | description |
---|---|---|
ignoreWarnings |
Default: true |
if {@code ignoreWarnings==true} then condition failure warnings will be ignored |
available response representations:
parameter | value | description |
---|---|---|
id |
the review perma id |
Uncompletes the review for the current user.
parameter | value | description |
---|---|---|
ignoreWarnings |
Default: true |
if {@code ignoreWarnings==true} then condition failure warnings will be ignored |
available response representations:
parameter | value | description |
---|---|---|
id |
the review perma-id (e.g. "CR-45"). |
Change the state of a review by performing an action on it.
parameter | value | description |
---|---|---|
action |
the string representation of the action to perform. Valid actions are:
|
|
ignoreWarnings |
Default: true |
if |
available response representations:
parameter | value | description |
---|---|---|
id |
the review perma id to close. it should be in the open state. |
Closes the given review with the summary given.
acceptable request representations:
available response representations:
parameter | value | description |
---|---|---|
id |
the review perma id to remind about. it should be in the open state. |
Provides an API for working with Projects.
Deprecated since FishEye 3.5.0 for removal in 4.0. Use GET /rest-service-fecru/admin/projects instead.
Get the list of projects that the authenticated user is entitled to access.parameter | value | description |
---|---|---|
excludeAllowedReviewers |
Default: false |
if set to true, user data (e.g. allowedReviewers) which is expensive to compute, will not be included in the response data. Defaults to false so allowedReviewers are included in the response. |
available response representations:
parameter | value | description |
---|---|---|
key |
the key of a Crucible project. |
Deprecated since FishEye 3.5.0 for removal in 4.0. Use GET /rest-service-fecru/admin/projects/[key] instead.
Returns a project description.If the specified project does not exist, or the caller does not have permission to access the project, 404 is returned.
parameter | value | description |
---|---|---|
excludeAllowedReviewers |
Default: false |
available response representations:
Returns a list of all repositories. This includes plugin provided repositories
parameter | value | description |
---|---|---|
name |
filter repositories by the repository key, only repositories of keys containing this value would be returned if value was provided. Case insensitive. |
|
enabled |
filter repositories by enabled flag. Only enabled/disabled repositories would be returned accordingly if value was provided. |
|
available |
filter repositories by its availability. Only available/unavailable repositories would be returned accordingly if value was provided. |
|
type |
filter repositories by type. Allowed values: cvs, svn, p4, git, hg, plugin (for light SCM repositories). Parameter can be specified more than once. |
|
limit |
Default: 10000 |
maximum number of repositories to be returned. |
available response representations:
parameter | value | description |
---|---|---|
path |
the path of a file. |
|
repository |
the key of the Crucible SCM plugin repository. |
|
revision |
the SCM revision string. |
Returns the raw content of the specified file revision as a binary stream. No attempt is made to identify the content type and no mime type is provided.
available response representations:
parameter | value | description |
---|---|---|
repository |
the key of the Crucible SCM plugin repository. |
|
revision |
the SCM revision string. |
parameter | value | description |
---|---|---|
path |
only show change sets which contain at least one revision with a path under this path. Changesets with some revisions outside this path still include all revisions. i.e. Revisions outside the path are *not* excluded from the change set. |
|
repository |
the key of the Crucible SCM plugin repository. |
Represents a sorted list of changesets, newest first.
Note that when providing a path, use a trailing slash in the request url to indicate that it is a directory (use a "/" for the root directory of the repository). This may be necessary for some SCM plugins (including svn-light).
parameter | value | description |
---|---|---|
oldestCsid |
only return change sets after this change set. If omitted there is no restriction. |
|
includeOldest |
include the change set with id "from" in the change sets returned. |
|
newestCsid |
only return change sets before this change set. If omitted there is no restriction. |
|
includeNewest |
include the change set with id "to" in the change sets returned. |
|
max |
return only the newest change sets, to a maximum of maxChangesets. |
available response representations:
parameter | value | description |
---|---|---|
path |
the path of a file or versioned directory (note that versioned directories are not supported by all SCM plugins). |
|
repository |
the key of the Crucible SCM plugin repository. |
|
revision |
the SCM revision string. |
Represents the details of a versioned entity (file or directory). This resource can be reached by following the file's self-link from a browse result.
Note that most responses support title expansion to minimize the costs of accessing the resources. Since file meta data is not always provided by SCM plugins, it is not expanded by default in the rest responses. Use title expansion to explicitly make Crucible include it.
The xml root element declares which elements are expandable (in this
response: details and diffRevision). To expand both, use:
?expand=details,diffRevision
available response representations:
parameter | value | description |
---|---|---|
repository |
the key of a FishEye or Crucible SCM plugin repository |
parameter | value | description |
---|---|---|
repository |
the key of the Crucible SCM plugin repository. |
Returns the details of the repository with the specified repository key. When the repository exists, but the user has no access to it (possibly because the user is not authenticated), a 401 is returned.
The supplied repository key can be either a Crucible SCM plugin repository, or a FishEye repository.
available response representations:
parameter | value | description |
---|---|---|
path |
path to a directory. When path represents a file name, the result is unspecified. |
|
repository |
the key of the Crucible SCM plugin repository. |
parameter | value | description |
---|---|---|
path |
the path of a file or versioned directory (note that versioned directories are not supported by all SCM plugins). |
|
repository |
the key of the Crucible SCM plugin repository. |
|
revision |
the SCM revision string. |