How to check whether a workitem has either a changeset or an attachment
Chandan M B (113●1●41●84)
| asked Jun 23 '15, 7:25 a.m.
edited Jun 23 '15, 8:27 a.m. by Ralph Schoon (63.7k●3●36●48)
Hi,
I need to check whether a workitem has either a changeset or an attachment in my server side extensions. Please provide me small snippet if anybody has done it !!! |
One answer
Ralph Schoon (63.7k●3●36●48)
| answered Jun 23 '15, 8:28 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
See https://rsjazz.wordpress.com/ use the search box in the top right to search for attachment.
Comments
Chandan M B
commented Jun 23 '15, 9:10 a.m.
I need to know whether the attachment is added to a workitem or not. If in case attachment is added, i need to retrieve the user who added the attachment in my follow up action in the server extension plugin.
Chandan M B
commented Jun 23 '15, 9:35 a.m.
Please see above
You perform Rational Team Concert Extensions Workshop to understand what you are doing, how and how to debug it and to learn how you can compare the old state and the new state.
Chandan M B
commented Jun 26 '15, 3:29 a.m.
Yes.
All that information is on https://rsjazz.wordpress.com/ For example:
|
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
IWorkItemReferencesworkItemReferences=workItemCommon.resolveWorkItemReferences(newState, monitor);List<IReference> references = workItemReferences.getReferences(WorkItemEndPoints.ATTACHMENT);
for(IReference reference:references){
IAttachmentHandle attachmentHandle=(IAttachmentHandle) reference.resolve();
IAttachment attachment=(IAttachment) itemService.fetchItem(attachmentHandle, IRepositoryItemService.COMPLETE);if(attachment!=null){
IContributorHandle attachmentContributorHandle = attachment.getCreator();
IContributor attachmentContributor = (IContributor) itemService.fetchItem(attachmentContributorHandle, IRepositoryItemService.COMPLETE);
String attachmentowner = attachmentContributor.getName();
System.out.println("Owner is ------- "+attachmentowner);
}
}