Is there a way to display attachments within the description
Accepted answer
Once the attachment is uploaded, it gets a numeric id from ccm. You can reference it then in the description by simple writting attachment followed by the given id (e.g attachment 312887) and that's it, ccm will change it to a link (e.g attachment 312887) and when the user hovers it, the image will be displayed in a popup window.
2 other answers
Hi,
here a (rudimentary) way to show attachments on your wi editor:
1. create a calculated value based on a script that returns the url of your attachment. Something like:
dojo.provide("org.example.workitems.providers.ShowPicture");
dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes");
(function() {
var WorkItemAttributes= com.ibm.team.workitem.api.common.WorkItemAttributes;
dojo.declare("org.example.workitems.providers.ShowPicture", null, {
getValue: function(attributeId, workItem, configuration) {
return "{{https://com.ibm.jazz.rtc.server:9443/ccm/service/com.ibm.team.workitem.common.internal.rest.IAttachmentRestService/itemName/com.ibm.team.workitem.Attachment/3|AttachmentImage}}";
}
});
})();
2. Create a custom attribute of Type Wiki based on the calculated value above
3. add the presentation on the editor
3. Synchronize attributes
Have fun.
You can add some logic in your script (change image based on status, etc.)
Enhance and share :-)
Don't forget to Enable Process Attachments Scripts in the Advanced Properties in ccm/admin (default is false - disabled)
here a (rudimentary) way to show attachments on your wi editor:
1. create a calculated value based on a script that returns the url of your attachment. Something like:
dojo.provide("org.example.workitems.providers.ShowPicture");
dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes");
(function() {
var WorkItemAttributes= com.ibm.team.workitem.api.common.WorkItemAttributes;
dojo.declare("org.example.workitems.providers.ShowPicture", null, {
getValue: function(attributeId, workItem, configuration) {
return "{{https://com.ibm.jazz.rtc.server:9443/ccm/service/com.ibm.team.workitem.common.internal.rest.IAttachmentRestService/itemName/com.ibm.team.workitem.Attachment/3|AttachmentImage}}";
}
});
})();
2. Create a custom attribute of Type Wiki based on the calculated value above
3. add the presentation on the editor
3. Synchronize attributes
Have fun.
You can add some logic in your script (change image based on status, etc.)
Enhance and share :-)
Don't forget to Enable Process Attachments Scripts in the Advanced Properties in ccm/admin (default is false - disabled)