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
3 other answers
![]()
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. |
![]() 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
|
![]()
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.
|
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.