List all Fortress work items
Moderator: SourceGear
List all Fortress work items
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
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
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
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
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};
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
That was awesome. Now that I see an example it makes sense. Just hunting through the intellisense was getting annoying.