I am able to connect to hpqc using com4j and also able to filter the defect. Now i need to access each item of the buglist.
I am able to access for a single defect like :
IBug bug = bugfactory.item(55203).queryInterface(IBug.class);
System.out.println(bug.field("BG_DEV_COMMENTS"));
But i want to be able to access all defect withing a List. So this is what i did:
IBugFactory bugfactory = td.bugFactory().queryInterface(IBugFactory.class);
ITDFilter fil = bugfactory.filter().queryInterface(ITDFilter.class);
fil.filter("BG_USER_13","Not Production");
IList buglist = fil.newList();
After this, I want to access each list item, so i did
for(int i=1;i<=buglist.count();i++{
IBug bug1 = buglist.item(i) // this statement is not working --
}
i cannot use IBug bug1 = buglist.item(i).queryinterface(IBug.class) statement as well.
What should be the correct code to access each item of the buglist and assign that to a Bug.
Solved it! Solution might be helpful for someone! This is what i did!
This gave ne the BugID's of all the defects within the buglist!