get/set the displayed name of an enumeration type attribute
hi
how do i get the displayed name of an enumeration type attribute ? how do i set a string in the enumeration type attribute? i would like to get the identifier of the string for that specific enumeration type attribute. (from String display name to Identifier to be able to do the setValue on workItem) String value = "my displayed name"; IAttribute fAttribute ; protected void execute( WorkItemWorkingCopy workingCopy, IProgressMonitor monitor ) throws TeamRepositoryException { IWorkItem workItem = workingCopy.getWorkItem(); Identifier attributeValue = workItem.getValue( fAttribute); workItem.setValue (?) ... } can i have some code example that i can look into? how can i access to the attribute type map? thank you stefania |
4 answers
Hi,
You can get the identifier like this:
And to get directly the displayName of an attribute you can do something like this:
I hope it helps. |
hi
thank you for your help on this i have to run this via client code not server code i don't have access to this IWorkItemServer workItemServer = getService(IWorkItemServer.class); to call the .resolveEnumeration(attr, null); what is the way to do the same with the client code? IWorkItemClient workItemClient = (IWorkItemClient)repository .getClientLibrary( IWorkItemClient.class ); i don't find the resolveEnumeration there. thank you Stefania |
never mind workItemClient has resolveEnumeration
workItemClient.resolveEnumeration(attr null); thanks |
|
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.