API: GetIsssues using CustomFields
I'm trying to get all the issues that have a non-null value for a CustomField: Iteration. I've created a filter but I don't see a way to set a filtering value for a particular type of CustomField.
List<ProjectEN> projects = WsManager.ProjectsService.GetProjects().ToList<ProjectEN>();
string projectIds = projects.Aggregate<ProjectEN,string>(string.Empty,(list, p) => list + p.ProjectID.ToString() + "|");
IssuesFilterEN filter = new IssuesFilterEN();
filter.ProjectID = projectIds;
filter.ExcludeClosed = false;
filter.
List<IssueEN> unfilteredIssues = new List<IssueEN>();
unfilteredIssues = WsManager.IssuesService.GetFilteredIssues(filter).ToList<IssueEN>();
IMHobbes
· 1 |
|
Monday, January 11, 2010, 4:54:18 PM |
0
|
Please See: http://community.countersoft.com/forums/thread/13416.aspx Howeevr, you can't filter for a not equals (or not null). |
||||
|
0
|
I've been able to filter by the customField, but now my entities only contain those customFields (as well as the rest of the issue data). I need some way to filter by one custom field while still getting all the return data for the other custom fields.
|
||||
|
0
|
Unfortunately, you will have to execute the another non-customfield filter. Basically, pass in the issue ids (pipe delimited) to the filter. |
||||
|
0
|
Alright, I've done something that works that I think is taking your advice. i have to say that it is cumbersome in the extreme. What I really want is a filter where i can find all the issues where the custom field exists, but where the value is not null. Then it should return the complete entities that match. Also, what is the reasoning behind explicitly having to identify the projects from which to choose the issues. Wouldn't it make sense that an empty project filter simply wouldn't filter out any issue by project? If a project is specified then it would only choose that project. Anyway, here's my code. if you see anything that can be done to improve the performance, i'm all ears.
|
||||
|
0
|
If you use GetPagedFilteredIssues to get the issues you will get all custom fields, removing the need to re-filter on issue ids. |
||||
|