Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

getting value from an enum of Workitem through Plain Java Library

Hi,
I looked at the Manipulating Work Item Enumeration Values. But it gives me an error at the method getIdentifier2() of ILiteral all the time. I tried 3.x version and even 4.x But no luck. It is quite urgent. Please help me.

Thanks.

private ILiteral getLiteralbyID(Identifier findLliteralID, IAttributeHandle iAttribute) throws TeamRepositoryException {
	IWorkItemClient workItemClient = (IWorkItemClient) teamRepository().getClientLibrary(IWorkItemClient.class);
	IEnumeration enumeration = workItemClient.resolveEnumeration(iAttribute, null);

	List literals = enumeration.getEnumerationLiterals();
	for (Iterator iterator = literals.iterator(); iterator.hasNext();) {
		ILiteral iLiteral = (ILiteral) iterator.next();
		if (iLiteral.getIdentifier2().equals(findLliteralID)) {
			return iLiteral;
		}
	}
	return null;
}

0 votes


Accepted answer

Permanent link
see post 2 here https://jazz.net/forum/questions/94776/assertionfailedexception-problem-with-getting-the-values-of-attributes

routine PrintAttributes()

detects what kind of attribute, then prints its value
Harish Raj selected this answer as the correct answer

0 votes

Comments

Thank you, Sam. :)

Your answer

Register or log in to post 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 7,499
× 1,221

Question asked: Feb 17 '14, 4:37 p.m.

Question was seen: 4,406 times

Last updated: Feb 18 '14, 1:53 p.m.

Confirmation Cancel Confirm