Web Services API Description
There are more than 20 available web services in TargetProcess. They provide common operations like:
- Create
- Update
- Delete
- GetByID
- Pre-defined Retrieve (RetrieveAll, RetrieveAllFor[Entity])
- Retrieve using NHibernate HQL queries
Bug Web Service is one of the most complex services, so below is a full description of Bug Service.
Bug Entity
Represents bug or defect (error, flaw, mistake, failure, or fault in a computer program). XML format of Bug Data Transfer Object:
<entity>
<BugID>int</BugID>
<Name>string</Name>
<TagsString>string</TagsString>
<Description>string</Description>
<StartDate>dateTime</StartDate>
<EndDate>dateTime</EndDate>
<CreateDate>dateTime</CreateDate>
<ModifyDate>dateTime</ModifyDate>
<LastCommentDate>dateTime</LastCommentDate>
<NumericPriority>float</NumericPriority>
<CustomField1>string</CustomField1>
<Effort>decimal</Effort>
<EffortCompleted>decimal</EffortCompleted>
<EffortToDo>decimal</EffortToDo>
<TimeSpent>decimal</TimeSpent>
<TimeRemain>decimal</TimeRemain>
<LastCommentUserID>int</LastCommentUserID>
<OwnerID>int</OwnerID>
<LastEditorID>int</LastEditorID>
<EntityStateID>int</EntityStateID>
<PriorityID>int</PriorityID>
<ProjectID>int</ProjectID>
<IterationID>int</IterationID>
<ParentID>int</ParentID>
<ReleaseID>int</ReleaseID>
<SeverityID>int</SeverityID>
<BuildID>int</BuildID>
<UserStoryID>int</UserStoryID>
<EntityTypeName>string</EntityTypeName>
<EntityStateName>string</EntityStateName>
<PriorityName>string</PriorityName>
<ProjectName>string</ProjectName>
<IterationName>string</IterationName>
<ParentName>string</ParentName>
<ReleaseName>string</ReleaseName>
<SeverityName>string</SeverityName>
<BuildName>string</BuildName>
<UserStoryName>string</UserStoryName>
</entity>
| Property Name | Type | Description |
| BugID | int | Bug identity |
| Name | string | Entity name or title |
| TagsString | string | Comma separated string of tags. Used only for TestCase for now |
| Description | string | Entity description |
| StartDate | dateTime | For example, start date of the iteration. Relevant for Iteration, Project, Release. |
| EndDate | dateTime | For example, end date of the iteration. Relevant for Iteration, Project, Release. |
| CreateDate | dateTime | Date when entity has been created |
| ModifyDate | dateTime | Date when entity has been modified |
| NumericPriority | float | Calculated priority of entity. Valid for UserStory and Bug for now |
| CustomField1 | string | Reserved property for custom field |
| CustomField2 | string | Reserved property for custom field |
| CustomField3 | string | Reserved property for custom field |
| CustomField4 | string | Reserved property for custom field |
| CustomField5 | string | Reserved property for custom field |
| CustomField6 | string | Reserved property for custom field |
| CustomField7 | string | Reserved property for custom field |
| CustomField8 | string | Reserved property for custom field |
| CustomField9 | string | Reserved property for custom field |
| CustomField10 | string | Reserved property for custom field |
| CustomField11 | string | Reserved property for custom field |
| CustomField12 | string | Reserved property for custom field |
| CustomField13 | string | Reserved property for custom field |
| CustomField14 | string | Reserved property for custom field |
| CustomField15 | string | Reserved property for custom field |
| Effort | decimal | Total effort of assignable. Can be set if only one ActorEffort for assignable exists |
| EffortCompleted | decimal | Effort spent on assignment. Read-only calculated field |
| EffortToDo | decimal | Effort required to complete assignment. Read-only calculated field |
| TimeSpent | decimal | Total time spent on assignment. Read-only calculated field |
| TimeRemain | decimal | Total time remaining to complete assignment for Actor. Read-only calculated field |
| OwnerID | int | Person who added the entity |
| LastEditorID | int | Person who edited entity last time |
| EntityStateID | int | State of assignable. For example, User Story may be in Open or Done state |
| PriorityID | int | Priority of assignable. For example, User Story may have Must Have or Nice To Have priority |
| ProjectID | int | Assignable should belong to Project |
| IterationID | int | Assignable may be assigned to Iteration or may be in Backlog (Iteration is not defined in this case) |
| ParentID | int | Used for Task only (Task parent is a User Story) |
| ReleaseID | int | Assignable may be assigned to Release or may be in project Backlog (Release is not defined in this case) |
| SeverityID | int | Severity (measure of injuriousness) of the bug. For example, Blocking, Critical, Small |
| BuildID | int | Build in which bug has been found. Optional. |
| UserStoryID | int | Bug may be associated with user story. Optional |
| EntityTypeName | string | Gets or sets the Entity Type Name. Type of the entity |
| EntityStateName | string | Gets or sets the Entity State Name. State of assignable. For example, User Story may be in Open or Done state |
| PriorityName | string | Gets or sets the Priority Name. Priority of assignable. For example, User Story may have Must Have or Nice To Have priority |
| ProjectName | string | Gets or sets the Project Name. Assignable should belong to Project |
| IterationName | string | Gets or sets the Iteration Name. Assignable may be assigned to Iteration or may be in Backlog (Iteration is not defined in this case) |
| ParentName | string | Gets or sets the Parent Name. Used for Task only (Task parent is a User Story) |
| ReleaseName | string | Gets or sets the Release Name. Assignable may be assigned to Release or may be in project Backlog (Release is not defined in this case) |
| SeverityName | string | Gets or sets the Severity Name. Severity (measure of injuriousness) of the bug. For example, Blocking, Critical, Small |
| BuildName | string | Gets or sets the Build Name. Build in which bug has been found. Optional |
| UserStoryName | string | Gets or sets the User Story Name. Bug may be associated with user story. Optional. |
Bug Web Service Methods
| Name | Description |
| AddAttachmentToBug | Adds the attachment to the specified Bug. Note: The filename is the name of existing file which should be uploaded to upload directory using FileService or manually. |
| AddBugWithAttachment | Adds the bug with attachment. |
| AddCommentToBug | Adds Comment to the specified Bug |
| AddRequestGeneralToBug | Adds Request General to the specified Bug |
| AddRevisionAssignableToBug | Adds Revision Assignable to the specified Bug |
| AddTeamToBug | Adds Team to the specified Bug |
| AssignUser | Assigns the user by id to the specified Bug. |
| AssignUserAsActor | Assigns the user by id as actor to the specified Bug. |
| AssignUserByEmailOrLogin | Assigns the user by email or login to the specified Bug. |
| AssignUserByEmailOrLoginAsActor | Assigns the user by email or login as actor to the specified Bug. |
| ChangeEffort | Changes the effort of specified Bug entity. |
| ChangeState | Changes state of Bug entity to the specified state. |
| Create | Creates the specified entity. |
| Delete | Deletes the entity with the specified id. |
| GetByID | Gets the entity by ID. |
| GetIDs | Retrieves the IDs of entities by specified HQL. |
| GetPriorities | Loads available priorities for Bug. |
| GetSeverities | Gets the severities. |
| RemoveAttachmentFromBug | Removes Attachment from specified Bug. |
| RemoveCommentFromBug | Removes Comment from specified Bug. |
| RemoveRequestGeneralFromBug | Removes Request General from specified Bug. |
| RemoveRevisionAssignableFromBug | Removes Revision Assignable from specified Bug. |
| RemoveTeamFromBug | Removes Team from specified Bug. |
| Retrieve | Retrieves the list if entities by specified HQL. |
| RetrieveActorEffortsForBug | Loads the child collection of Actor Effort entities for specified Bug. |
| RetrieveAll | Retrieves all. |
| RetrieveAllForBuild | Loads Bug entities by specified Build. |
| RetrieveAllForEntityState | Loads Bug entities by specified Entity State. |
| RetrieveAllForIteration | Loads Bug entities by specified Iteration. |
| RetrieveAllForLastCommentUser | Loads Bug entities by specified General User. |
| RetrieveAllForOwner | Loads Bug entities by specified General User. |
| RetrieveAllForPriority | Loads Bug entities by specified Priority. |
| RetrieveAllForProject | Loads Bug entities by specified Project. |
| RetrieveAllForRelease | Loads Bug entities by specified Release. |
| RetrieveAllForSeverity | Loads Bug entities by specified Severity. |
| RetrieveAllForUserStory | Loads Bug entities by specified User Story. |
| RetrieveAttachedRequestsForBug | Loads the child collection of Request General entities for specified Bug. |
| RetrieveAttachmentsForBug | Loads the child collection of Attachment entities for specified Bug. |
| RetrieveCommentsForBug | Loads the child collection of Comment entities for specified Bug. |
| RetrieveCount | Retrieves the count. |
| RetrieveOpenForMe | Loads open Bug entities for the currently logged in user. |
| RetrieveOpenForUser | Loads open Bug entities for specified user |
| RetrievePage | Retrieves the page (the range) of entities. |
| RetrieveRevisionAssignablesForBug | Loads the child collection of Revision Assignable entities for specified Bug. |
| RetrieveTeamsForBug | Loads the child collection of Team entities for specified Bug. |
| Update | Updates the specified entity. |
Examples
Retrieve bug by id
BugServiceWse bugService = new BugServiceWse();
TpPolicy.ApplyAutheticationTicket(bugService, "admin", "admin");
BugDTO bug = bugService.GetByID(97);Console.WriteLine(bug.Name);
Add new bug into TargetProcess
BugServiceWse bugService = new BugServiceWse();
TpPolicy.ApplyAutheticationTicket(bugService, "admin", "admin");
BugDTO bug = new BugDTO();
bug.Name = "New bug";
bug.CreateDate = DateTime.Today;
bug.Description = "Bug Description";
bug.ProjectID = 1;
int bugId = bugService.Create(bug);
Console.WriteLine(bugId);
Delete bug from TargetProcess
BugServiceWse bugService = new BugServiceWse();TpPolicy.ApplyAutheticationTicket(bugService, "admin", "admin");
bugService.Delete(bugId);
Update bug
BugServiceWse bugService = new BugServiceWse();
TpPolicy.ApplyAutheticationTicket(bugService, "admin", "admin");
BugDTO bug = bugService.GetByID(bugId);
bug.Name = "Updated bug";
bugService.Update(bug);