Get the Attributes Value for a given WorkItem in Java Plain API
Hello, I have a simple question for you surely, but since I'm brand new I don't know how to do it. How to get the value of any attribute of a WorkItem with Plain Java API? I already have the workitem in my code with: workItem = workItemClient.findWorkItemById(workItemNumber, IWorkItem.FULL_PROFILE, new SysoutProgressMonitor()) but now I want to show some of its attributes with its values and I don't know how to continue.
Thanks for the help. |
Accepted answer
see the second post here.. how to dump all the attributes via the plain java client api
https://jazz.net/forum/questions/94776/assertionfailedexception-problem-with-getting-the-values-of-attributes Tiago Fernandez selected this answer as the correct answer
Comments
Tiago Fernandez
commented Aug 12 '13, 9:31 p.m.
Thanks for the reply, but as I mentioned at the begining, I am brand new and in that post there are plenty lines of code. Could you specify a very simple example in a couple a lines on how to get the value of any attibute given a workItem? Thank you. |
3 other answers
no problem.. same code as in my example. I handle it by looking at the attribute type, then switching() based on the type to the right routine.
|
I figured out myself, thanks. Following some examples (they are in Groovy since I am working on that lengauge, similar to Java):
// Getting the workItem
//Getting the WorkItem Owner
//Geting the WorkItem State
|
I hear you, but there is no 'simple' few statement example.
the routine that does the attribute work is <code> static void printAttributes(IWorkItem workItem, IAuditableClient auditableClient, IProjectArea projectArea, org.eclipse.core.runtime.IProgressMonitor monitor, ITeamRepository repository, String XML) { } </code> it loops thru all the attributes and handles each one on the fly. but you will need to have the project area and the AuditableClient library handle. Comments
Tiago Fernandez
commented Aug 13 '13, 2:53 p.m.
Yes, there is a simple way, I figured out myself. It is in the next answer... |
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.