Can anyone please provide a sample java client which will get all the attributes and the values of the specified workitem
Can anyone please provide a sample java client which will get all the attributes and the values of the specified workitem
|
2 answers
Ralph Schoon (63.1k●3●36●45)
| answered Feb 10 '14, 8:21 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
You can get at the built in attributes from somewhere else:
log("WorkItem: " + workItem.getId() + " " + workItem.getHTMLSummary().getPlainText() + "\t Type " + workItemType.getDisplayName() + "\n"); ListYou can find more information about e.g. casting here: https://rsjazz.wordpress.com/2013/03/20/understanding-and-using-the-rtc-java-client-api/ Comments
Trilok Chand
commented Feb 10 '14, 8:30 a.m.
Below is my example i am trying... List builtInAttributeHandles = workItemClient.findBuiltInAttributes(projectArea, null);
Just want to use this someAttribute variable to get the workItem and finally to print the value of the attribute... Can you please help me in this... Or please if you have any class file, you can share me... I will refer to that and complete the rest.. Thanks |
List<IAttributeHandle> customAttributeHandles = workitem
.getCustomAttributes(); for (IAttributeHandle attributeHandle : customAttributeHandles) { IAttribute attribute = (IAttribute) teamRepository.itemManager() .fetchCompleteItem(attributeHandle, IItemManager.DEFAULT, null); //.... do something with attribute. } Please note that this only fetches custom attributes. I'm not sure if it's possible to fetch all attributes. You normally access built-in attributes, by their individual getters and setters, for example: workitem.getDueDate(...) Comments
Trilok Chand
commented Feb 10 '14, 8:18 a.m.
Hi,
Ralph Schoon
commented Feb 10 '14, 8:25 a.m.
| edited Feb 10 '14, 8:25 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
I guess you have to write that yourself as I did below.
sam detweiler
commented Feb 10 '14, 11:39 a.m.
see the function static void printAttributes(IWorkItem workItem,
in post 2 of this topic
this will print the details for all attributes of a workitem
|
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.