Questions for Confluence license has expired.

Please purchase a new license to continue using Questions for Confluence.

Adding a new watcher to the Jira Issue

 
1
0
-1

Hello,


I need to automatically add a new watcher to issues that have been created from Exalate. How can I do that through the rules?


e.g. issue.watchers = “username"


I also want to filter what attachments are sync’d. Is this possible using some kind of regex match?


e.g. I don’t want to sync attachments that have a specific prefix.


Thanks!

-Dewayne

    CommentAdd your comment...

    6 answers

    1.  
      1
      0
      -1

      André,

      Thanks so much for the fast reply. Will startsWith work the same as endsWith?


      e.g.

      replica.attachments = issue.attachments.findAll { attachment -> attachment.filename.startsWith("String_") }




      1. André Leroy-Beaulieu Castro

        Hi Dewayne,


        Could you try this:


        replica.attachments = issue.attachments.findAll { attachment ->
        !(attachment.filename.startsWith("String_")) }
      2. Dewayne Lavelle

        Andre, if I wanted to go the other route and only accept attachments that have a specific prefix how would I do that?

      CommentAdd your comment...
    2.  
      1
      0
      -1

      Hi Dewayne,


      This should work to send only the attachments where the filename is prefixed with MGC_ for example:


      replica.attachments = issue.attachments.findAll { attachment ->
      attachment.filename.startsWith("MGC_")) }


      Let me know how this goes!


      Thanks,


      André

        CommentAdd your comment...
      1.  
        1
        0
        -1

        Andre, If I wanted to go the other way and only accept attachments with 'MGC_' prefix how would I accomplish this?

          CommentAdd your comment...
        1.  
          1
          0
          -1

          Andre,

          What about ignoring Attachments that contain a specific prefix?

            CommentAdd your comment...
          1.  
            1
            0
            -1

            Actually I want to ignore attachments that match a specific prefix.

              CommentAdd your comment...
            1.  
              1
              0
              -1

              Hi Dewayne,


              To set a watcher you can use the line:


              Incoming Sync:

              issue.watchers += nodeHelper.getUserByEmail("youremail@gmail.com")


              in the following link you can also see an example on how to filter attachments by it's body and filename:


              https://docs.idalko.com/exalate/display/ED/Attachments+synchronization


              Thanks,


              André

                CommentAdd your comment...