It replaces the values of the choice list data with that from the specified LookUp
object. Uninitialized properties are cleared.
First, you usually call LookUps_Load to get an array of all entity’s choice lists, obtain an individual list, add, or delete values on the list and then pass the updated object to LookUps_Update.
Requirements
Any user can add new values to the list, but, in order to delete or replace the values, the authenticating user must belong to a group that has the Delete privilege for Projects.
Parameters
The operation uses the following parameters:
AuthenticationData : AuthenticationData, required
An AuthenticationData
object containing the login information and the project ID that contains the choice list.
Entity : string, required
The entity code which choice list you want to update. 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
LookUp : LookUp, required
The LookUp
object that contains the information on the choice list with updated set of values.
Result
None.
Example
Sample Code
C#
string login = "[email protected]";
string password = "p@ssword";
int projID = 10372;
// Specifying the desired entity
string entity = "Defects";
// Specifying the desired custom list
string lookUpType = "Bugs-Custom1";
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;
LookUp[] lookUps = service.LookUps_Load(authData, entity);
LookUp lookUp = null;
foreach (LookUp templookUp in lookUps)
{
// Finding the desired choice list in the array
if (templookUp.Type == lookUpType)
{
lookUp = templookUp;
break;
}
}
if (lookUp != null)
{
// Specifying new values
ArrayOfString values = lookUp.Values;
values.Add("Users");
values.Add("Developers");
// Updating the choice list
service.LookUps_Update(authData, entity, lookUp);
Console.WriteLine("The {0} choice list is updated", lookUp.Description);
}
else
{
Console.WriteLine("The LookUp type specified incorrectly");
}
Java
String login = "[email protected]";
String password = "p@ssword";
int projID = 10372;
// Specifying the desired entity
String entity = "Defects";
// Specifying the desired choice list
String lookUpType = "Bugs-Custom1";
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();
LookUp lookUp = null;
for (LookUp tempLookUp : lookUps)
{
// Finding the desired choice list in the array
if (tempLookUp.getType().equals(lookUpType))
{
lookUp = tempLookUp;
break;
}
}
if (lookUp != null)
{
// Specifying new values
List<String> values = lookUp.getValues().getString();
values.add("Customers");
values.add("QA");
// Updating the choice list
service.lookUpsUpdate(authData, entity, lookUp);
System.out.format("The %s choice list is updated", lookUp.getDescription());
}
else
{
System.out.println("The LookUp type specified incorrectly");
}
Sample Request XML
POST /psws/psws.asmx HTTP/1.1
Host: myteam.mysite.com
Content-Type: text/xml; charset=utf-8
Content-Length: 650 {Insert an appropriate value here}
SOAPAction: "http://www.pragmaticsw.com/LookUps_Update"
<?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_Update 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>
<LookUp>
<Type>Bugs-Custom1</Type>
<Description>Defect - Found In Build</Description>
<Values>
<string>Customers</string>
<string>QA</string>
</Values>
</LookUp>
</LookUps_Update>
</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: 658 {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_Update 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>
<LookUp>
<Type>Bugs-Custom1</Type>
<Description>Defect - Found In Build</Description>
<Values>
<string>Customers</string>
<string>QA</string>
</Values>
</LookUp>
</LookUps_Update>
</soap12:Body>
</soap12:Envelope>
Sample Response XML
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: 308 {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_UpdateResponse xmlns="http://www.pragmaticsw.com/" />
</soap:Body>
</soap:Envelope>
SOAP 1.2
HTTP/1.1 200 OK
Content-Type: application/soap+xml; charset=utf-8
Content-Length: 318 {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_UpdateResponse xmlns="http://www.pragmaticsw.com/" />
</soap12:Body>
</soap12:Envelope>