Page 1 of 1
List all Fortress work items
Posted: Mon Oct 20, 2008 1:01 pm
by DetroitJ
I can't seem to find a method in the API to list all the items for a project. There is a ProcessCommandListMyOpenFortressItems and ProcessCommandListOpenFortressItems method but these only show open items. Is there a way to do this from the API?
Re: List all Fortress work items
Posted: Mon Oct 20, 2008 1:08 pm
by shannon
Those are just convenience functions for the queries we run most often. You'd want to construct a MantisItemQueryFilter and pass it to ProcessCommandQueryFortressItems. Let me know if you need more help than that to get going.
Re: List all Fortress work items
Posted: Mon Oct 20, 2008 1:18 pm
by DetroitJ
I saw that but I could not find an example or documentation of the MantisItemQueryFilter. Basically, I want a list of all items for a given project id/name sorted by last modified date. If there is any docs or links you can point me to that would be great. Thank you.
Re: List all Fortress work items
Posted: Mon Oct 20, 2008 1:31 pm
by DetroitJ
I did manage to piece together a MantisItemQueryFilter. I only specified the Project ID and it seemed to give me the results I was expecting except for the sorting. Any docs or examples would still be handy though. Thanks again for the help.
Re: List all Fortress work items
Posted: Mon Oct 20, 2008 1:35 pm
by shannon
I didn't run this or anything, so forgive me if there are any small typos. Fill in your values and give it a try:
MantisItemQueryFilter qf = new MantisItemQueryFilter();
qf.ProjectLevelFilterID = <yourProjID>;
qf.Types = new int[] {<openItemType>.ID}; // get this from ProcessCommandListFortressItemTypes, just loop over those and get the one you want
MantisItemQuerySort sort = new MantisItemQuerySort(MantisLib.ItemSortType.LAST_MODIFIED);
qf.Sorts = new MantisItemQuerySort[] {sort};
Re: List all Fortress work items
Posted: Mon Oct 20, 2008 1:53 pm
by DetroitJ
That was awesome. Now that I see an example it makes sense. Just hunting through the intellisense was getting annoying.
Re: List all Fortress work items
Posted: Mon Oct 20, 2008 1:56 pm
by shannon
Glad I could help.