How to fetch Filed Against all values for plugin combo box?
Hi,
I have designed plugin form for create workitem.
i can able to get all values of custom enumaration attributes.
Let me know how to get the all values of Release, Planned For and Filed Against from My Project Area using Plain java client or plugin design.
could any suggest me the solution.
Thanks,
Glory
I have designed plugin form for create workitem.
i can able to get all values of custom enumaration attributes.
Let me know how to get the all values of Release, Planned For and Filed Against from My Project Area using Plain java client or plugin design.
could any suggest me the solution.
Thanks,
Glory
3 answers
Hi,
i have found the solution for fetching Filed Against attribute.
find my code below.
public static String[] getFiledAgainstList() throws TeamRepositoryException {
String[] list = null;
IProgressMonitor monitor = new NullProgressMonitor();
IAttribute attribute= workItemClient.findAttribute(projectArea,IWorkItem.CATEGORY_PROPERTY, monitor );
int i =0;
try {
ItemProfile<ICategory> profile= ICategory.DEFAULT_PROFILE.createExtension(ICategory.CATEGORY_ID);
List<ICategory> enumeration = workItemClient.findCategories(projectArea, profile, monitor);
list = new String;
for (ICategory literal : enumeration) {
list = literal.getName();
System.out.println(literal.getName());
i++;
}
} catch (TeamRepositoryException e) {
}
return list;
}
Thanks,
Glory
i have found the solution for fetching Filed Against attribute.
find my code below.
public static String[] getFiledAgainstList() throws TeamRepositoryException {
String[] list = null;
IProgressMonitor monitor = new NullProgressMonitor();
IAttribute attribute= workItemClient.findAttribute(projectArea,IWorkItem.CATEGORY_PROPERTY, monitor );
int i =0;
try {
ItemProfile<ICategory> profile= ICategory.DEFAULT_PROFILE.createExtension(ICategory.CATEGORY_ID);
List<ICategory> enumeration = workItemClient.findCategories(projectArea, profile, monitor);
list = new String;
for (ICategory literal : enumeration) {
list = literal.getName();
System.out.println(literal.getName());
i++;
}
} catch (TeamRepositoryException e) {
}
return list;
}
Thanks,
Glory
Hi,
i have found the solution for fetching Found in (Release) Attribute.
check my code below.
@SuppressWarnings("unchecked")
public static String[] getReleaseList() throws TeamRepositoryException {
String[] list = null;
System.out.println("Inside getReleaseList");
IProgressMonitor monitor = new NullProgressMonitor();
int i =0;
try {
ItemProfile<IDeliverable> profile= IDeliverable.DEFAULT_PROFILE;
List<IDeliverable> enumeration = workItemClient.findDeliverablesByProjectArea(projectArea, true, profile, monitor);
list = new String;
for (IDeliverable literal : enumeration) {
list = literal.getName();
// System.out.println(literal.getName());
i++;
}
} catch (TeamRepositoryException e) {
}
return list;
}
Thanks ,
Glory
i have found the solution for fetching Found in (Release) Attribute.
check my code below.
@SuppressWarnings("unchecked")
public static String[] getReleaseList() throws TeamRepositoryException {
String[] list = null;
System.out.println("Inside getReleaseList");
IProgressMonitor monitor = new NullProgressMonitor();
int i =0;
try {
ItemProfile<IDeliverable> profile= IDeliverable.DEFAULT_PROFILE;
List<IDeliverable> enumeration = workItemClient.findDeliverablesByProjectArea(projectArea, true, profile, monitor);
list = new String;
for (IDeliverable literal : enumeration) {
list = literal.getName();
// System.out.println(literal.getName());
i++;
}
} catch (TeamRepositoryException e) {
}
return list;
}
Thanks ,
Glory
Comments
Fatos Sopjani
Feb 06 '13, 9:56 a.m.Hi Glory,
pugazhenthi samidurai
Feb 06 '13, 11:51 p.m.Hi ,
Please check below code to get Selected value of the filed Against field.
public static String getFiledAgainst(IWorkItem workitem)
{
IItemManager itm = teamRepository.itemManager();
ICategory category = null;
try {
category = (ICategory) itm.fetchCompleteItem(workitem.getCategory(), IItemManager.DEFAULT, null);
} catch (TeamRepositoryException e) {
ErrorLog.error(e.getLocalizedMessage());
}
return category.getName();
}