Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Mylyn » Programmatic new task creation from Java into Bugzilla????
Programmatic new task creation from Java into Bugzilla???? [message #65215] Fri, 13 February 2009 21:38 Go to next message
Vinny  is currently offline Vinny Friend
Messages: 20
Registered: July 2009
Junior Member
Sorry, this is a duplicate to my previous post but I'm not sure if this is
the best place to post this question. Please advise if I should post
elsewhere.

I've used the example code at:
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.mylyn/s andbox/org.eclipse.mylyn.examples.bugzilla/src/org/eclipse/m ylyn/internal/examples/bugzilla/Main.java?root=Tools_Project &view=markup


to query a bug report and modify a comment but I can't seem to find how to
create a new bug from the Java API. Is the Java API fully functionally?
I.e., can everything be done programatically that can be done from the
Mylyn GUI? After a few days of poking around, it seems like the API is
not fully developed.

Can anyone show an example of how to create a NEW bug and put it into the
Bugzilla DB from a Java program?

I'm trying to interface with Bugzilla 3.2.2.


Would really appreciate the help! Thanks in advance!
Re: Programmatic new task creation from Java into Bugzilla???? [message #66273 is a reply to message #65215] Sun, 08 March 2009 22:10 Go to previous message
Alexander Karnstedt is currently offline Alexander KarnstedtFriend
Messages: 68
Registered: July 2009
Member
Hi Vinny

recently had the same problem. I managed to figure it out by rummaging through
the code:

AbstractTaskDataHandler taskDataHandler = connector
.getTaskDataHandler();
TaskAttributeMapper mapper = taskDataHandler
.getAttributeMapper(repository);

TaskData newTask = new TaskData(mapper, repository
.getConnectorKind(), repository.getRepositoryUrl(), "");

TaskMapping taskMappingInit = new TaskMapping() {
public String getProduct() {
return "My Product";
}
};

taskDataHandler.initializeTaskData(repository, newTask,
taskMappingInit, new NullProgressMonitor());

TaskAttribute attribute = newTask.getRoot().getAttribute(
BugzillaAttribute.SHORT_DESC.getKey());
attribute.setValue("Test Bug");

attribute = newTask.getRoot().getAttribute(
BugzillaAttribute.LONG_DESC.getKey());
attribute.setValue("--- Description ---");

attribute = newTask.getRoot().getAttribute(
BugzillaAttribute.COMPONENT.getKey());
attribute.setValue("RCP Client");

client.postTaskData(newTask, new NullProgressMonitor());


Regards
Alex

Vinny schrieb am 13.02.2009 22:38:
> Sorry, this is a duplicate to my previous post but I'm not sure if this
> is the best place to post this question. Please advise if I should post
> elsewhere.
> I've used the example code at:
> http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.mylyn/s andbox/org.eclipse.mylyn.examples.bugzilla/src/org/eclipse/m ylyn/internal/examples/bugzilla/Main.java?root=Tools_Project &view=markup
>
>
>
> to query a bug report and modify a comment but I can't seem to find how
> to create a new bug from the Java API. Is the Java API fully
> functionally? I.e., can everything be done programatically that can be
> done from the Mylyn GUI? After a few days of poking around, it seems
> like the API is not fully developed.
> Can anyone show an example of how to create a NEW bug and put it into
> the Bugzilla DB from a Java program?
>
> I'm trying to interface with Bugzilla 3.2.2.
>
> Would really appreciate the help! Thanks in advance!
>
Re: Programmatic new task creation from Java into Bugzilla???? [message #596597 is a reply to message #65215] Sun, 08 March 2009 22:10 Go to previous message
Alexander Karnstedt is currently offline Alexander KarnstedtFriend
Messages: 68
Registered: July 2009
Member
Hi Vinny

recently had the same problem. I managed to figure it out by rummaging through
the code:

AbstractTaskDataHandler taskDataHandler = connector
.getTaskDataHandler();
TaskAttributeMapper mapper = taskDataHandler
.getAttributeMapper(repository);

TaskData newTask = new TaskData(mapper, repository
.getConnectorKind(), repository.getRepositoryUrl(), "");

TaskMapping taskMappingInit = new TaskMapping() {
public String getProduct() {
return "My Product";
}
};

taskDataHandler.initializeTaskData(repository, newTask,
taskMappingInit, new NullProgressMonitor());

TaskAttribute attribute = newTask.getRoot().getAttribute(
BugzillaAttribute.SHORT_DESC.getKey());
attribute.setValue("Test Bug");

attribute = newTask.getRoot().getAttribute(
BugzillaAttribute.LONG_DESC.getKey());
attribute.setValue("--- Description ---");

attribute = newTask.getRoot().getAttribute(
BugzillaAttribute.COMPONENT.getKey());
attribute.setValue("RCP Client");

client.postTaskData(newTask, new NullProgressMonitor());


Regards
Alex

Vinny schrieb am 13.02.2009 22:38:
> Sorry, this is a duplicate to my previous post but I'm not sure if this
> is the best place to post this question. Please advise if I should post
> elsewhere.
> I've used the example code at:
> http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.mylyn/s andbox/org.eclipse.mylyn.examples.bugzilla/src/org/eclipse/m ylyn/internal/examples/bugzilla/Main.java?root=Tools_Project &view=markup
>
>
>
> to query a bug report and modify a comment but I can't seem to find how
> to create a new bug from the Java API. Is the Java API fully
> functionally? I.e., can everything be done programatically that can be
> done from the Mylyn GUI? After a few days of poking around, it seems
> like the API is not fully developed.
> Can anyone show an example of how to create a NEW bug and put it into
> the Bugzilla DB from a Java program?
>
> I'm trying to interface with Bugzilla 3.2.2.
>
> Would really appreciate the help! Thanks in advance!
>
Previous Topic:Changelogs and release notes for Mylyn components
Next Topic:Download and upload attachments via API (Bugzilla)
Goto Forum:
  


Current Time: Wed Jul 17 09:57:58 GMT 2024

Powered by FUDForum. Page generated in 0.03633 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top