LookUps_Load Operation

Applies to QAComplete 14.4, last modified on June 20, 2024

Returns an array of all LookUp objects that represent choice lists of the specified entity.

The operation can get choice lists from one or several projects. To specify a project to get choice lists from, use the ProjId value in the AuthenticationData object in the request body. To get choice lists from several projects, use the ProjIds value in the AuthenticationData object to specify the list of project IDs.

Requirements

The authenticating user must belong to a user group that has the Read privilege for the needed item type.

Parameters

The operation uses the following parameters:

AuthenticationData  :  AuthenticationData, required

An AuthenticationData object with the login information and the ID of the project (or the list of project IDs) whose choice lists you want to get.

Entity  :  string, required

The entity whose choice lists you want to get. Possible values:

  • Bugs (defects)
  • Contacts
  • 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 the LookUp objects that contain information on the choice lists of the specified entity.

Example

Sample Code

C#

string login = "[email protected]";
string password = "p@ssword";
int projID = 10372;

// Specifying the desired entity
string entity = "Defects";

ServiceSoapClient service = new ServiceSoapClient();

// Preparing 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;

// Loading an array of LookUp objects
LookUp[] lookUps = service.LookUps_Load(authData, entity);
foreach (LookUp lookUp in lookUps)
{
  string values = "";
  foreach (string value in lookUp.Values)
  {
  // Preparing a string with the list of values
    values = values + value + ", ";
  }
  if (values != "")
  {
    values = values.Remove(values.Length - 2, 2);
    Console.WriteLine("{0} contains values: {1}", lookUp.Description, values);
  }
  else
  {
    Console.WriteLine("{0} does not contain values.", lookUp.Description);
  }
}

Java

String login = "[email protected]";
String password = "p@ssword";
int projId = 10372;
// Specified the desired entity
String entity = "Defects";


ServiceSoap service = new Service().getServiceSoap12();

// Preparing 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);

// Loading an array of LookUp objects
List<LookUp> lookUps = service.lookUpsLoad(authData, entity).getLookUp();
for (LookUp lookUp : lookUps)
{
  String values = "";
  for (String value : lookUp.getValues().getString())
  {
    values += value + ", ";
  }
  if (values != "")
  {
    values = values.substring(0, values.length()-2);
    System.out.format("%s contains values: %s%n", lookUp.getDescription(), values);
  }
  else
  {
    System.out.format("%s does not contain values.", lookUp.getDescription());
  }
}

Sample Request XML

POST /psws/psws.asmx HTTP/1.1
Host: myteam.mysite.com
Content-Type: text/xml; charset=utf-8
Content-Length: 492 {Insert an appropriate value here}
SOAPAction: "http://www.pragmaticsw.com/LookUps_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>
    <LookUps_Load xmlns="http://www.pragmaticsw.com/">
      <AuthenticationData>
        <AppCode>agSP</AppCode>
        <DeptId>7154</DeptId>
        <ProjId>1032</ProjId>
        <UserId>25315</UserId>
        <PassCode>p@ssword</PassCode>
      </AuthenticationData>
      <Entity>Defects</Entity>
    </LookUps_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: 500 {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>
    <LookUps_Load xmlns="http://www.pragmaticsw.com/">
      <AuthenticationData>
        <AppCode>agSP</AppCode>
        <DeptId>7154</DeptId>
        <ProjId>1032</ProjId>
        <UserId>25315</UserId>
        <PassCode>p@ssword</PassCode>
      </AuthenticationData>
      <Entity>Defects</Entity>
    </LookUps_Load>
  </soap12:Body>
</soap12:Envelope>

Sample Response XML

HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: 685 {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>
    <LookUps_LoadResponse xmlns="http://www.pragmaticsw.com/">
      <LookUps_LoadResult>
        <LookUp>
          <Type>BugReleaseLinkTypes</Type>
          <Description>Bugs - Release Link Types</Description>
          <Values>
            <string>Found In</string>
            <string>Fixed In</string>
          </Values>
        </LookUp>
        <LookUp>
          <Type>Bugs-Custom1</Type>
          <Description>Defects - Found By</Description>
          <Values>
            <string>Customers</string>
            <string>QA</string>
          </Values>
        </LookUp>
      </LookUps_LoadResult>
    </LookUps_LoadResponse>
  </soap:Body>
</soap:Envelope>

SOAP 1.2

HTTP/1.1 200 OK
Content-Type: application/soap+xml; charset=utf-8
Content-Length: 695 {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>
    <LookUps_LoadResponse xmlns="http://www.pragmaticsw.com/">
      <LookUps_LoadResult>
        <LookUp>
          <Type>BugReleaseLinkTypes</Type>
          <Description>Bugs - Release Link Types</Description>
          <Values>
            <string>Found In</string>
            <string>Fixed In</string>
          </Values>
        </LookUp>
        <LookUp>
          <Type>Bugs-Custom1</Type>
          <Description>Defects - Found By</Description>
          <Values>
            <string>Customers</string>
            <string>QA</string>
          </Values>
        </LookUp>
      </LookUps_LoadResult>
    </LookUps_LoadResponse>
  </soap12:Body>
</soap12:Envelope>

See Also

LookUps_Update
Choice Lists Operations
SOAP API Reference

Highlight search results