It's all about the answers!

Ask a question

How to fetch Filed Against all values for plugin combo box?


glory pugazhenthi (5699) | asked Mar 30 '12, 5:35 a.m.
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

Comments
Fatos Sopjani commented Feb 06 '13, 9:56 a.m.

 Hi Glory, 


How would you find out the selected item of filed against? I need to know only the item selected rather than the whole list of items.


Thanks,
F


pugazhenthi samidurai commented 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();
}

3 answers



permanent link
glory pugazhenthi (5699) | answered Apr 02 '12, 3:14 a.m.
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

permanent link
glory pugazhenthi (5699) | answered Apr 02 '12, 1:56 a.m.
Hi,


How to get the values of Planned For and Found in attributes.


Thanks,

Glory

permanent link
glory pugazhenthi (5699) | answered Apr 02 '12, 1:55 a.m.
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

Your answer


Register or to post your answer.