1
0
-1

How can I synchronize from Jira Service to Zendesk an internal comment as an internal comment, and a public comment as a public comment? 


So far the only thing I know how to do is to pass all public and private comments from Jira as internal to Zendesk. How do I make that difference? 


Thanks!

    CommentAdd your comment...

    1 answer

    1.  
      1
      0
      -1

      Hi Fran Sánchez 

      Checkout the How to manage comment visibility document
      Just set the comment.internal to true or false.

      (this is for scripted connections)

      1. Fran Sánchez

        Thank you very much for your reply. 

        Yes, I checked it, but I don't see how to make the comparison to determine if what I get is an internal or external comment and then apply true or false to the attribute. 

        I have tried several things, but it does not work:


        issue.comments = commentHelper.mergeComments(issue, replica, {
          comment ->
           if (replica.internal) {
            comment.internal = true
           }else{
            comment.internal = false       
           }
            comment
          }
        )


        Where is the error? 

        Best regards

      2. Fran Sánchez

        any idea Francis Martens (Exalate)?? thanks for the help!! 



      3. Francis Martens (Exalate)

        It is always handy to know what the cause of the problem is.
        What you need to know is what the value of replica.internal is.

        One way of doing so is to add in your code a debug statement which will raise an error showing the information you need to know


        issue.comments = commentHelper.mergeComments(issue, replica, {
          comment ->
        
        
        debug.error("The value of replica.internal is ${replica.internal}")
           if (replica.internal) {
            comment.internal = true
           }else{
            comment.internal = false       
           }
            comment
          }
        )

        And then trigger an incoming sync.  And review the output of the debug statement ...

        I guess that replica.internal doesn't exist.

      4. Fran Sánchez

        Thank you very much for your response. I was unaware of the debugging option. It is perfect.

        Once tested I confirm that indeed replica.internal is null. However I have debugged the replica.comments of the Jira outgoint sync and despite having public and private comments I see that everything comes out as public. So it is logical that Zendesk cannot differentiate between private and public. 

        Why is this?  I attach the image in which you can see that I have in Jira public and private comments, the image of the lines that I am debugging and part of the debug result where you can see that all comments: @internal= `false`.


        replica.comments    = issue.comments
        debug.error("The value of comments is ${replica.comments}")


        Comments private and public in Jira:


        Result of the debug:

        BasicHubComment{@body=`new12`, @id=`10229`, @remoteId=`null`, @author=`{ @key : 70121:9c815981-e9a2-45bd-af56-2d60fee20b8a}`, @created=`Thu Jan 27 08:56:21 UTC 2022`, @updateAuthor=`{ @key : 70121:9c815981-e9a2-45bd-af56-2d60fee20b8a}`, @updated=`Thu Jan 27 08:56:21 UTC 2022`, @group=`null`, @role=`null`, @internal= `false`, @executor= `null`}, BasicHubComment{@body=`newpublica`, @id=`10230`, @remoteId=`null`, @author=`{ @key : 70121:9c815981-e9a2-45bd-af56-2d60fee20b8a}`, @created=`Thu Jan 27 09:02:45 UTC 2022`, @updateAuthor=`{ @key : 70121:9c815981-e9a2-45bd-af56-2d60fee20b8a}`, @updated=`Thu Jan 27 09:02:45 UTC 2022`, @group=`null`, @role=`null`, @internal= `false`, @executor= `null`}, BasicHubComment{@body=`new interna`, @id=`10231`, @remoteId=`null`, @author=`{ @key : 70121:9c815981-e9a2-45bd-af56-2d60fee20b8a}`, @created=`Thu Jan 27 09:02:50 UTC 2022`, @updateAuthor=`{ @key : 70121:9c815981-e9a2-45bd-af56-2d60fee20b8a}`, @updated=`Thu Jan 27 09:02:50 UTC 2022`, @group=`null`, @role=`null`, @internal= `false`, @executor= `null`}, BasicHubComment{@body=`responder al cliente`, @id=`10232`, @remoteId=`null`, @author=`{ @key : 70121:9c815981-e9a2-45bd-af56-2d60fee20b8a}`, @created=`Thu Jan 27 14:51:10 UTC 2022`, @updateAuthor=`{ @key : 70121:9c815981-e9a2-45bd-af56-2d60fee20b8a}`, @updated=`Thu Jan 27 14:51:10 UTC 2022`, @group=`null`, @role=`null`, @internal= `false`, @executor= `null`}
      5. Francis Martens (Exalate)


        The rest api of Jira reports all comments as public whenever the request type is not set ...

        Is the request type set on the JIra side?

      6. Fran Sánchez


        I thi think so, it's the green icon next to the ticket ID, isn't it? or am I wrong?



      7. Francis Martens (Exalate)

        This is an example of a request type set


        on Jira Server


        On Jira cloud


        Can you check and confirm

      8. Fran Sánchez

        Hello, that was the problem. Once I assigned a request type to the tickets I have already been able to differentiate between public and internal comments later in Zendesk for what I needed. thank you very much for the help provided! 

      CommentAdd your comment...