[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [mylyn-integrators] Re: [mylyn-dev] Retrieving a Bugzilla Custom Field is failing
|
To achieve this you would need to invoke queries to get all ids then
retrieve the task data as required. There is no getAllBugs().
-Rob
On Tue, Apr 21, 2009 at 2:21 PM, Vincent Vallarine <vvallarine@xxxxxxxxx> wrote:
> Thank You Rob. My issue is that I need a faster way to get all the
> values for a particular custom field. The first chunk of code assumes I
> know the task id and I don't. So what I do is loop on all task ids from
> 0 and I keep incrementing until I get an taskData of null returned,
> meaning that the task id is not in the repo and I stop after that. I
> then use all the taskData objects to parse out of each the custom field
> I'm looking for. This all works but its very slow. If there are 1000's
> of bugs in the repo, its not usable this way.
>
> Is there any way to "getAllBugs()" or something like that?
>
>
>
> Thanks,
>
>
> Vinny
>
>
>
>
> On Tue, 2009-04-21 at 12:10 -0400, Robert Elves wrote:
>> Hi Vincent,
>>
>> The data returned from a query is partial (taskData.isPartial() ==
>> true) (we don't get all the data returned in the query results). To
>> ensure you have all attributes you need to use the first chunk of code
>> you mentioned below.
>>
>> -Rob
>>
>>
>> On Mon, Apr 20, 2009 at 5:35 PM, Vincent Vallarine
>> <vvallarine@xxxxxxxxx> wrote:
>> The two snippets of code I think should work the same, I'm
>> trying to get
>> all value of a custom field. The first chuck works fine. The
>> second
>> chunck does not work, I get the exact number of task back that
>> I expect
>> and all the data is correct except when I do a
>> "getMappedAttribute("my_custom_field")" using the query, the
>> result is
>> always null.
>>
>>
>> // WORKING SNIPPET
>> TaskData taskData = connector.getTaskData(repository, taskId,
>> new NullProgressMonitor());
>>
>> System.out.println("Getting attribute for task id " + id);
>>
>> //works fine, can get the custom value out of attrib
>> TaskAttribute attrib = taskData.getRoot().getMappedAttribute(
>> "my_custom_field");
>>
>>
>>
>>
>> //NOT WORKING SNIPPET
>> String QUERY_NAME = "Query Page Name";
>> String QUERY_STRING = "/buglist.cgi?product=SomeProject";
>> IRepositoryQuery repositoryQuery =
>> TasksUi.getRepositoryModel()
>> .createRepositoryQuery(repository);
>> repositoryQuery.setUrl(repository.getRepositoryUrl() +
>> QUERY_STRING);
>> repositoryQuery.setSummary(QUERY_NAME);
>>
>> final Set<TaskData> changedTaskData = new HashSet<TaskData>();
>> TaskDataCollector resultCollector = new TaskDataCollector() {
>>
>> public void accept(TaskData taskData) {
>> changedTaskData.add(taskData);
>> }
>> };
>>
>> IStatus status = connector.performQuery(repository,
>> repositoryQuery, resultCollector, null, new
>> NullProgressMonitor());
>>
>> for (TaskData taskData : changedTaskData) {
>>
>> //Always returns null!!!
>> TaskAttribute attrib = taskData.getRoot().getMappedAttribute(
>> "my_custom_field");
>>
>> }
>>
>> _______________________________________________
>> mylyn-dev mailing list
>> mylyn-dev@xxxxxxxxxxx
>> https://dev.eclipse.org/mailman/listinfo/mylyn-dev
>>
>>
>>
>> --
>> Robert Elves
>> Tasktop Developer, http://tasktop.com/
>> Mylyn Committer, http://eclipse.org/mylyn
>> plain text document attachment (ATT24280.txt)
>> _______________________________________________
>> mylyn-dev mailing list
>> mylyn-dev@xxxxxxxxxxx
>> https://dev.eclipse.org/mailman/listinfo/mylyn-dev
> _______________________________________________
> mylyn-integrators mailing list
> mylyn-integrators@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/mylyn-integrators
>
--
Robert Elves
Tasktop Developer, http://tasktop.com/
Mylyn Committer, http://eclipse.org/mylyn