1
0
-1

Question raised: How do I only send attachments which were attached within 12hrs ?

    CommentAdd your comment...

    1 answer

    1.  
      1
      0
      -1

      You can do:

      //get system current time in milliseconds
      long currentTimeMilliseconds = System.currentTimeMillis()
      //43200000 = 12hours in milliseconds
      //send only attachments within 12 hours elapsed in milliseconds 
      replica.attachments = issue.attachments.findAll { attachment -> (currentTimeMilliseconds - attachment.created.getTime() <= 43200000)
      } 
        CommentAdd your comment...