Questions for Confluence license has expired.

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

send comments to Zendesk only if certain text is found in ADO comment eg: @send2Zendesk if found in comments section only then will it sync to zendesk

 
1
0
-1

How do i send comments to Zendesk only if certain text is found in ADO comment eg: @send2Zendesk if found in comments section only then will it sync to zendesk

    CommentAdd your comment...

    3 answers

    1.  
      2
      1
      0

      Hello Sarita,


      Place the following code in your Azure DevOps Outgoing Sync

      workItem.comments.collect{ comment ->
      if(comment.body.contains("@send2Zendesk")){
      replica.comments += comment
      }
      }
      replica.comments       = nodeHelper.stripHtmlFromComments(replica.comments)
      
      

      This code snippet will only add to the replica, the comments that contain the following text: "send2Zendesk".


      Regards,

      Javier Pozuelo

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



        I also tried the reverse from zendesk to ado only for internal comments with below script  and it worked


        def intc = issue.comments.findAll{it.internal}
        def matchingComments = intc.findAll
        {
            comment ->
            comment.body =~ /@send2ado/
        }



        replica.comments += matchingComments

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

          Yes it worked..Thanks 

            CommentAdd your comment...