Uploaded image for project: 'SR for Jira - Development'
  1. SR for Jira - Development
  2. SRJIRA-3296

Unable to use send mail attachments callback on Service Desk project

    XMLWordPrintableJSON

Details

    • 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

      Attachments

        Activity

          People

            jdavis Jenna Davis
            dmondardo Damiano Mondardo [X] (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: