How to get workietm type field value?
Hi,
i am using plain java client for fetching all work items. But i am unable to fetch the value of work item type field. Please look my previous post for more information. https://jazz.net/forums/viewtopic.php?t=24856&highlight= |
5 answers
from your prior post. I think the text 'customerid' is the workitem 'type'
|
Hi sam,
its correct. But that doesn't return any values. It return only null value. Please suggest me any solution. |
sorry, I am confused..
I think I see three outputs if you change your code like this(adding single quotes to the literals in the message format) System.out.print("Custom: '" +customString.getIdentifier()+"' \t'" +customString.getDisplayName()+"' \t'"+customString.getAttributeType()+"'"); Custom: 'customerid' 'Customer ID' 'workItem' workItemType represents the arbitrary string u defined in the project config. that string is returned by 'getIdentifier()' not getType(). getType() is 'workitem' |
Hi sam,
I am using the below function to retrieve work item type value. But it doen't return any value. public static String getWorkitemTypeFieldValue(IWorkItem workItem,String fCustomStringAttributeID) { ITeamRepository repository = RepositoryManager.getInstance().getCurrentRepository(); IWorkItemClient workItemClient = (IWorkItemClient) repository.getClientLibrary(IWorkItemClient.class); IAuditableCommon iac = workItemClient.getAuditableCommon(); IProgressMonitor monitor = new NullProgressMonitor(); IProjectArea projectArea = null; try { projectArea = getReportOneProjectArea(); } catch (TeamRepositoryException e2) { e2.printStackTrace(); } IAttribute customString = null; try { customString = workItemClient.findAttribute(projectArea, fCustomStringAttributeID, null); } catch (TeamRepositoryException e) { e.printStackTrace(); } String sValue = ""; if(value!=null && value instanceof String) { sValue = (String) value; System.out.print("\tValue: " + sValue); } System.out.println(); return sValue; } Let me know is there any other way to get the value of work item type field. |
I don't understand.. Type is not an attribute..
so workitem.getWorkitemType() should return the value you seek. from the javadoc getWorkItemType java.lang.String getWorkItemType() Returns the work item type. |
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.