![]()  | 
Since release 10.2, this functionality is obsolete and is supported for backward compatibility only. We recommend that you use QAComplete REST API to access and manage data in QAComplete. | 
Creates a new defect in QAComplete.
Use the ProjId value in the AuthenticationData parameter to specify the project to create the defect in.
Requirements
The authenticating user must belong to a user group that has the Add privilege for Defects.
Parameters
The operation uses the following parameters:
AuthenticationData : AuthenticationData, required
An AuthenticationData object containing the login information and the project ID to create the defect in.
Bug : Bug, required
A Bug object containing the defect information.
SendEmailAlert : string
Y means send an email alert to the subscribed users after adding the defect.
Any other value (for example, N or empty string) means do not send e-mail alerts.
 The parameter is optional in QAComplete 10.2 and later. In QAComplete 10.1 and ealier, it is required.
NewNotes : string
A note to add to the defect. Default value: empty string.
Result
An integer ID of the created defect.
Remarks
The Bug object you pass in must have all property values required by your QAComplete instance. You can see the required properties in two places:
- 
Required fields for defects: > Setup > System Configuration > Screen Layouts > Defects > Required Fields.
 - 
Defect workflow transitions: Defects > Show Defects > Tools > Manage Workflows > select status > Select fields for this Transition.
 
Do not specify the following properties, they are set automatically:
- 
DateCreated,DateOpenedandDateUpdatedare set to the current date and time. - 
UpdateUserIdandUserNameare set to the authenticating user. - 
If
StatusCodecontains the wordClosed:- 
ClosedBy,ClosedByName,ResolvedByandResolvedByNameare set to the authenticating user. - 
DateClosed,ActStartandActFinishare set to the current date and time. - 
PctCompleteis set to 100. 
 - 
 - 
If
StatusCodecontains the wordResolved:- 
DateResolvedis set to the current date and time. - 
ResolvedByandResolvedByNameare set to the authenticating user. 
 - 
 
The Bug object has matching Id and Name properties, for example, FolderId and FolderName. To set them, specify the value only for the Id property. The corresponding Name property will be set automatically.
Example

Sample Code
See Create Defects.

Sample Request XML
POST /psws/psws.asmx HTTP/1.1
Host: myteam.mysite.com
Content-Type: text/xml; charset=utf-8
Content-Length: 779 {Insert an appropriate value here}
SOAPAction: "http://www.pragmaticsw.com/Bugs_Add"
 
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <Bugs_Add xmlns="http://www.pragmaticsw.com/">
      <AuthenticationData>
        <AppCode>agSP</AppCode>
        <DeptId>7154</DeptId>
        <ProjId>1032</ProjId>
        <UserId>25315</UserId>
        <PassCode>p@ssword</PassCode>
      </AuthenticationData>
      <Bug>
        <Title>Floating toolbar improvements</Title>
        <StatusCode>Active</StatusCode>
        <PriorityCode>2-Fix Soon</PriorityCode>
        <Description><![CDATA[The design of the floating toolbar needs improvement so that it’s clearer what the user needs to do.]]></Description>
      </Bug>
      <SendEmailAlert>N</SendEmailAlert>
      <NewNotes></NewNotes>
    </Bugs_Add>
  </soap:Body>
</soap:Envelope>
SOAP 1.2
POST /psws/psws.asmx HTTP/1.1
Host: myteam.mysite.com
Content-Type: application/soap+xml; charset=utf-8
Content-Length: 787 {Insert an appropriate value here}
 
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Body>
    <Bugs_Add xmlns="http://www.pragmaticsw.com/">
      <AuthenticationData>
        <AppCode>agSP</AppCode>
        <DeptId>7154</DeptId>
        <ProjId>1032</ProjId>
        <UserId>25315</UserId>
        <PassCode>p@ssword</PassCode>
      </AuthenticationData>
      <Bug>
        <Title>Floating toolbar improvements</Title>
        <StatusCode>Active</StatusCode>
        <PriorityCode>2-Fix Soon</PriorityCode>
        <Description><![CDATA[The design of the floating toolbar needs improvement so that it’s clearer what the user needs to do.]]></Description>
      </Bug>
      <SendEmailAlert>N</SendEmailAlert>
      <NewNotes></NewNotes>
    </Bugs_Add>
  </soap12:Body>
</soap12:Envelope>

Sample Response XML
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: 354 {The server returns an appropriate value here}
 
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <Bugs_AddResponse xmlns="http://www.pragmaticsw.com/">
      <Bugs_AddResult>43</Bugs_AddResult>
    </Bugs_AddResponse>
  </soap:Body>
</soap:Envelope>
SOAP 1.2
HTTP/1.1 200 OK
Content-Type: application/soap+xml; charset=utf-8
Content-Length: 364 {The server returns an appropriate value here}
 
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 		xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Body>
    <Bugs_AddResponse xmlns="http://www.pragmaticsw.com/">
      <Bugs_AddResult>43</Bugs_AddResult>
    </Bugs_AddResponse>
  </soap12:Body>
</soap12:Envelope>
See Also
Defects Operations
Bugs_Delete
Bugs_GetStatuses
Bugs_Load
Bugs_LoadByCriteria
Bugs_Update
SOAP API Reference