Questions for Confluence license has expired.

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

Synchronize comment author from Salesforce to Jira

 
1
0
-1

We’re trying to sync a case comment author from Salesforce to Jira Cloud but it’s not working as the author is always “Exalate”.

I’ve followed the documentation to add this code :



issue.comments = commentHelper.mergeComments(issue, replica){ it.executor = nodeHelper.getUserByEmail(it.author?.email) }


I’ve also made sure that the comment author exists on Jira and has the permissions to access the project and add comments.


Please advise.

    CommentAdd your comment...

    1 answer

    1.  
      2
      1
      0

      Hi Andres,


      I was able to reproduce the problem from Salesforce to Jira Cloud:


      To achieve what is needed, you will need to inspect the local replica from Salesforce side, and you will get something like:


      "comments": [
            {
              "id": "00a5f000000oZGfAAM",
              "author": {
                "key": "0055f000000xGlUAAU",
                "active": false
              },
              "body": "TEST internal comment.",
              "created": 1648252800000,
              "internal": true,
              "restrictSync": false
            }

      Then, once you know the author key, what you will need is to define a user mapping:

      final def userMapping = [
            "0055f000000xGlUAAU" : "ariel.aguilar@idalko.com"
      ]
      issue.comments = commentHelper.mergeComments(
        issue,
        replica,
        {
          it.executor = nodeHelper.getUserByEmail(userMapping[it.author?.key]);it
        }
      )

      I just tested it and it worked for me.



      Kind regards,

      Ariel

        CommentAdd your comment...