Use this web service to add enhancements programmatically or to register defects. The service is available after authorization. Every service method takes, as its first parameter, the key obtained after authorization.
Protocol: SOAP, WebService
Link: http://<host>/api/supportservice
WSDL description (document/literal): http://<host>/api/supportservice?wsdl
WSDL description (rpc/encoded): http://<host>/api/supportservice?wsdl&style=rpc&use=encoded
| Name | Return value | Purpose |
|---|---|---|
|
RaiseIssue (string token.Key, request issue) |
request |
Creates an Issue with the parameters set as attribute values of the issue variable. |
|
AttachFile (string token.Key, request issue, attachment file) |
attachment |
Attaches a file to the Issue identified by issue.Id. File attributes and the file body are contained in the file variable. |
| Name | Attribute | Purpose |
|---|---|---|
|
Request |
Id |
Object identifier |
|
|
Caption |
Issue/defect name |
|
|
Description |
Issue/defect description |
|
Attachment |
Id |
Object identifier |
|
|
FilePath |
File name that will be displayed in the project |
|
|
FileExt |
File MIME type |
|
|
File |
A base64binary text field that contains the file body in base64 encoding |
// авторизуемся в проекте
security.SecurityService api = new security.SecurityService() {
Url = 'http://<host>/api/securityservice'
};
support.SupportService _supportService = new support.SupportService() {
Url = 'http://<host>/api/securityservice'
};
security.Token _token = api.login("guest", "guest", "development");
var issue = new support.request() {
Caption = "Краткое описание ошибки",
Description = "Подробное описание ошибки"
};
issue = _supportService.RaiseIssue(_token.Key, issue);
// загружаем файл, например, дамп
string fileName = Environment.GetEnvironmentVariable("windir") + "\\notepad.exe";
FileStream fs = File.Open(fileName, FileMode.Open, FileAccess.Read);
byte[] fileBytes = new byte[fs.Length];
fs.Read(fileBytes, 0, (int)fs.Length);
fs.Close();
support.attachment file = support.attachment
{
FilePath = "notepad.exe",
FileExt = (new FileInfo(fileName)).Extension,
File = fileBytes
};
_supportService.AttachFile(_token.Key, issue, file);