It's all about the answers!

Ask a question

create workitem automaticly in background

yansheng li (1175) | asked Oct 25 '11, 4:07 a.m.
Dear all

I have two question :

1. I want to create workitem automaticly by right click a file in package explorer, I work based on which will prompt a workitem edit window, so how to create workitem without display the window.

2. I have one customized attribute, how to set the value of this attribute.
maybe in WorkItemInitialization

protected void execute(WorkItemWorkingCopy workingCopy, IProgressMonitor monitor) throws TeamRepositoryException {

One answer

permanent link
yansheng li (1175) | answered Oct 25 '11, 11:19 a.m.
For the second question, I have solved by this solution:

List<IAttribute> attributes=client.resolveAuditables(workItem.getCustomAttributes(),IAttribute.FULL_PROFILE, monitor);
for (Iterator<IAttribute> e = attributes.iterator(); e.hasNext();) {
IAttribute aa = (IAttribute);
System.out.println ("==The attribute is"+aa.getDisplayName());
if (aa.getDisplayName().compareTo(PRGANME_VALUE)==0) {
workItem.setValue(aa, "AAAA.JAVA");

Your answer

Register or to post your answer.