How can I save a work item?
Hi,
How can I save a work item if I only have the IWorkItem object?
What I want to do is I want to save the work item after I append comments to the work item. Here is how I append the comments: (workitem is an IWorkItem object)
IComments comments = workitem.getComments();
IComment c = comments.createComment(
repo.loggedInContributor(),
XMLString.createFromPlainText("test"));
comments.append(c);
So now, how can I save the workitem?
Any help is appreicated. Thanks alot.
How can I save a work item if I only have the IWorkItem object?
What I want to do is I want to save the work item after I append comments to the work item. Here is how I append the comments: (workitem is an IWorkItem object)
IComments comments = workitem.getComments();
IComment c = comments.createComment(
repo.loggedInContributor(),
XMLString.createFromPlainText("test"));
comments.append(c);
So now, how can I save the workitem?
Any help is appreicated. Thanks alot.
4 answers
How can I save a work item if I only have the IWorkItem object?
What I want to do is I want to save the work item after I append
comments to the work item. Here is how I append the comments:
(workitem is an IWorkItem object)
IComments comments = workitem.getComments();
IComment c = comments.createComment(
repo.loggedInContributor(),
XMLString.createFromPlainText("test"));
comments.append(c);
So now, how can I save the workitem?
In general, you would do this to create a new work item:
IWorkItemWorkingCopyManager workingCopyManager=
workItemClient.getWorkItemWorkingCopyManager();
IWorkItemHandle handle= workingCopyManager.connectNew(fgDefectType,
null);
WorkItemWorkingCopy workingCopy=
workingCopyManager.getWorkingCopy(handle);
workingCopy.getWorkItem().setHTMLSummary(XMLString.createFromPlainText(getName()));
workingCopy.save(null);
If you have an existing item, use connect(handle) instead of
connectNew(type) on the working copy manager.
Please see also
https://jazz.net/wiki/bin/view/Main/ProgrammaticWorkItemCreation
--
Regards,
Patrick
Jazz Work Item Team
Thanks alot! I can now saved the work item.
To answer the previous question, I'm doing this on the client side.
Thanks.
In general, you would do this to create a new work item:
IWorkItemWorkingCopyManager workingCopyManager=
workItemClient.getWorkItemWorkingCopyManager();
IWorkItemHandle handle= workingCopyManager.connectNew(fgDefectType,
null);
WorkItemWorkingCopy workingCopy=
workingCopyManager.getWorkingCopy(handle);
workingCopy.getWorkItem().setHTMLSummary(XMLString.createFromPlainText(getName()));
workingCopy.save(null);
If you have an existing item, use connect(handle) instead of
connectNew(type) on the working copy manager.
Please see also
https://jazz.net/wiki/bin/view/Main/ProgrammaticWorkItemCreation
--
Regards,
Patrick
Jazz Work Item Team
To answer the previous question, I'm doing this on the client side.
Thanks.
How can I save a work item if I only have the IWorkItem object?
What I want to do is I want to save the work item after I append
comments to the work item. Here is how I append the comments:
(workitem is an IWorkItem object)
IComments comments = workitem.getComments();
IComment c = comments.createComment(
repo.loggedInContributor(),
XMLString.createFromPlainText("test"));
comments.append(c);
So now, how can I save the workitem?
In general, you would do this to create a new work item:
IWorkItemWorkingCopyManager workingCopyManager=
workItemClient.getWorkItemWorkingCopyManager();
IWorkItemHandle handle= workingCopyManager.connectNew(fgDefectType,
null);
WorkItemWorkingCopy workingCopy=
workingCopyManager.getWorkingCopy(handle);
workingCopy.getWorkItem().setHTMLSummary(XMLString.createFromPlainText(getName()));
workingCopy.save(null);
If you have an existing item, use connect(handle) instead of
connectNew(type) on the working copy manager.
Please see also
https://jazz.net/wiki/bin/view/Main/ProgrammaticWorkItemCreation
--
Regards,
Patrick
Jazz Work Item Team
How can this be done on server side
Please let me know
In general, you would do this to create a new work item:
IWorkItemWorkingCopyManager workingCopyManager=
workItemClient.getWorkItemWorkingCopyManager();
IWorkItemHandle handle= workingCopyManager.connectNew(fgDefectType,
null);
WorkItemWorkingCopy workingCopy=
workingCopyManager.getWorkingCopy(handle);
workingCopy.getWorkItem().setHTMLSummary(XMLString.createFromPlainText(getName()));
workingCopy.save(null);
If you have an existing item, use connect(handle) instead of
connectNew(type) on the working copy manager.
Please see also
https://jazz.net/wiki/bin/view/Main/ProgrammaticWorkItemCreation
--
Regards,
Patrick
Jazz Work Item Team
Please let me know
Thanks alot! I can now saved the work item.
To answer the previous question, I'm doing this on the client side.
Thanks.
How can I save a work item if I only have the IWorkItem object?
What I want to do is I want to save the work item after I append
comments to the work item. Here is how I append the comments:
(workitem is an IWorkItem object)
IComments comments = workitem.getComments();
IComment c = comments.createComment(
repo.loggedInContributor(),
XMLString.createFromPlainText("test"));
comments.append(c);
So now, how can I save the workitem?
In general, you would do this to create a new work item:
IWorkItemWorkingCopyManager workingCopyManager=
workItemClient.getWorkItemWorkingCopyManager();
IWorkItemHandle handle= workingCopyManager.connectNew(fgDefectType,
null);
WorkItemWorkingCopy workingCopy=
workingCopyManager.getWorkingCopy(handle);
workingCopy.getWorkItem().setHTMLSummary(XMLString.createFromPlainText(getName()));
workingCopy.save(null);
If you have an existing item, use connect(handle) instead of
connectNew(type) on the working copy manager.
Please see also
https://jazz.net/wiki/bin/view/Main/ProgrammaticWorkItemCreation
--
Regards,
Patrick
Jazz Work Item Team