Details
-
Bug
-
Status: Done
-
Low
-
Resolution: Done
-
5.4.48, 5.4.49
-
None
-
Sprint 48, Sprint 49, Sprint 50, Sprint 51, Sprint 52
-
0.8
Description
The Script Listener "Send custom email" allows users to set a custom callback to filter the attachments.
If the listener is mapped on a Service Desk project, the following custom callback
import com.onresolve.scriptrunner.canned.jira.workflow.postfunctions.
{
MailAttachment a -> a.isNew()
}
will not return any attachment because the isNew() method always return a false value even when there is an attachment on the new comment made.
Steps to replicate:
- Create a "Send a custom email" listener mapped to a Service Desk project
- Map it to an event like "Issue Commented"
- Select "HTML" as mail format
- On the "Include Attachments" field select "Custom"
- Place this script inside the "Custom attachment callback" field:
import com.onresolve.scriptrunner.canned.jira.workflow.postfunctions.MailAttachment { MailAttachment a -> a.isNew() }
- Now create an issue from the Service Desk portal
- Add a comment with an attachment
- The mail does not contain the full attachment file but only the standard Service Desk link to the attachment