set creator of IAttachment (client side)
Hi,
I've created some code with jazz plain api to export e-mail message to RTC. It's worked fine.
I tried to search how can I set creator of IAttachment but could not find. Is it possible to adjust the creator?
Thank you in advance for your answer. |
Accepted answer
Ralph Schoon (63.5k●3●36●46)
| answered Sep 01 '14, 9:39 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER edited Sep 01 '14, 9:41 a.m.
Well, you can try to use the INTERNAL interface com.ibm.team.workitem.common.internal.model.Attachment . Be warned, that is internal API and can change and so on. Example:
((Attachment) newAttachment).setCreator(value); szasz gabor selected this answer as the correct answer
Comments PS: if you want to do things you shouldn't do, it is always an option to look into the implementation classes and other analogue interfaces that might be available.
szasz gabor
commented Sep 04 '14, 3:44 a.m.
It's work. Thank you.
|
One other answer
Hello,
I guess that you can not set the creator of an attachment.
IAttachment API only enables you to getCreator().
Reading through the code, the creator is set at creation time, using the user id that performs the operation.
In your case, the process / code that exports the email to RTC.
Eric
|
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.
Comments
There is a method IAttachment IWorkItemServer.saveAttachment witch create IAttachment from Attachment. If I can use this method in client side, I have possibility to set the uploaded attachment creator.
Someone has tried to use this method in client side?
behind each I* interface class is a concrete class implementation of the interface.
those classes are in the internal libraries.
the Attachment implementation class has a setCreator(IContributorHandle);
you cast the IAttachment to Attachment, then you can use the setCreator method.
and then save like always
just a reminder, internal classes are not documented, and could change at any time, use at your own risk. you cannot open a defect against and internal api change