Returns a list of custom fields in the specified QAComplete projects and project area (Defects, Requirements, and so on).
The operation can get custom fields from one or several projects. To specify a project to get custom fields from, use the ProjId
value in the AuthenticationData
object in the request body. To get custom fields from several projects, use the ProjIds
value in the AuthenticationData
object to specify the list of project IDs.
Requirements
The user must belong to a user group that has the Manage custom fields privilege.
Parameters
The operation uses the following parameters:
AuthenticationData : , required
An AuthenticationData
object with the login information and the ID of the project (or the list of project IDs) whose custom fields you want to get.
Entity : string, required
The area whose custom fields you want to get. Possible values:
- Bugs (defects)
- Contacts
- FileExchanges (shared documents)
- FunctionalSpecs (requirements)
- ProjectPlans
- ProjectPlanTasks
- ProjectTasks (agile tasks)
- Releases
- TestCases (legacy test cases used in release 9.6.0 and earlier)
- TestConfigurations
- Tests
- TestSets
Result
An array of CustomField
objects that represent the custom fields.
Example
Sample Code
This example lists all custom fields defined for defects in the project with ID 10372.
C#
string login = "[email protected]";
string password = "p@ssword";
int projID = 10372;
string area = "Bugs";
ServiceSoapClient service = new ServiceSoapClient();
// Prepare AuthenticationData
LoginInfo loginInfo = service.GetLoginInfo("", login, password);
AuthenticationData authData = new AuthenticationData();
authData.AppCode = loginInfo.AppCode;
authData.UserId = loginInfo.UserId;
authData.PassCode = password;
authData.DeptId = loginInfo.DeptId;
authData.ProjId = projID;
// Gets custom fields
CustomField[] customFields = service.CustomFields_Load(authData, area);
foreach (CustomField field in customFields)
{
Console.WriteLine("{0}: {1}", field.CustomFieldNbr, field.FieldName);
}
Java
String login = "[email protected]";
String password = "p@ssword";
int projID = 10372;
String area = "Bugs";
ServiceSoap service = new Service().getServiceSoap12();
// Prepare AuthenticationData
LoginInfo loginInfo = service.getLoginInfo("", login, password);
AuthenticationData authData = new AuthenticationData();
authData.setAppCode(loginInfo.getAppCode());
authData.setUserId(loginInfo.getUserId());
authData.setPassCode(password);
authData.setDeptId(loginInfo.getDeptId());
authData.setProjId(projID);
// Gets custom fields
List<CustomField> customFields = service.customFieldsLoad(authData, area).getCustomField();
for (CustomField field : customFields)
{
System.out.format("%d: %s%n", field.getCustomFieldNbr(), field.getFieldName());
}
Sample Request XML
POST /psws/psws.asmx HTTP/1.1
Host: myteam.mysite.com
Content-Type: text/xml; charset=utf-8
Content-Length: 500 {Insert an appropriate value here}
SOAPAction: "http://www.pragmaticsw.com/CustomFields_Load"
<?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>
<CustomFields_Load xmlns="http://www.pragmaticsw.com/">
<AuthenticationData>
<AppCode>agSP</AppCode>
<DeptId>8162</DeptId>
<ProjId>11873</ProjId>
<UserId>24661</UserId>
<PassCode>p@ssword</PassCode>
</AuthenticationData>
<Entity>Bugs</Entity>
</CustomFields_Load>
</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: 508 {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>
<CustomFields_Load xmlns="http://www.pragmaticsw.com/">
<AuthenticationData>
<AppCode>agSP</AppCode>
<DeptId>8162</DeptId>
<ProjId>11873</ProjId>
<UserId>24661</UserId>
<PassCode>p@ssword</PassCode>
</AuthenticationData>
<Entity>Bugs</Entity>
</CustomFields_Load>
</soap12:Body>
</soap12:Envelope>
Sample Response XML
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: 809 {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>
<CustomFields_LoadResponse xmlns="http://www.pragmaticsw.com/">
<CustomFields_LoadResult>
<CustomField>
<EntityCode>Bugs</EntityCode>
<CustomFieldNbr>1</CustomFieldNbr>
<FieldName>Critical Issue</FieldName>
<FieldType>Yes / No</FieldType>
<FieldSize>3</FieldSize>
<IsRequired>N</IsRequired>
</CustomField>
<CustomField>
<EntityCode>Bugs</EntityCode>
<CustomFieldNbr>2</CustomFieldNbr>
<FieldName>Found in Build</FieldName>
<FieldType>SQL Look Up</FieldType>
<FieldSize>100</FieldSize>
<IsRequired>Y</IsRequired>
</CustomField>
</CustomFields_LoadResult>
</CustomFields_LoadResponse>
</soap:Body>
</soap:Envelope>
SOAP 1.2
HTTP/1.1 200 OK
Content-Type: application/soap+xml; charset=utf-8
Content-Length: 819 {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>
<CustomFields_LoadResponse xmlns="http://www.pragmaticsw.com/">
<CustomFields_LoadResult>
<CustomField>
<EntityCode>Bugs</EntityCode>
<CustomFieldNbr>1</CustomFieldNbr>
<FieldName>Critical Issue</FieldName>
<FieldType>Yes / No</FieldType>
<FieldSize>3</FieldSize>
<IsRequired>N</IsRequired>
</CustomField>
<CustomField>
<EntityCode>Bugs</EntityCode>
<CustomFieldNbr>2</CustomFieldNbr>
<FieldName>Found in Build</FieldName>
<FieldType>SQL Look Up</FieldType>
<FieldSize>100</FieldSize>
<IsRequired>Y</IsRequired>
</CustomField>
</CustomFields_LoadResult>
</CustomFields_LoadResponse>
</soap12:Body>
</soap12:Envelope>
See Also
CustomFields_Add
CustomFields_AddLookUp
CustomFields_Delete
Custom Field Operations
SOAP API Reference