Send only public comments from Jira Service Management
This guides describe how you can send the comment only when there is a public comment made in JSM (e.g. Share with customers button)
Follow the steps or download the template here.
 Instructions
Create an Action called Comment Receiver
Select template category: Jira Service Desk Server
Select template: Get request comments
Click Create
Change the URL to:
{{baseUrl}}/rest/servicedeskapi/request/{{issue.key}}/comment/{{comments.latest.id}}
Select the authentication to be a user that can login to Jira and fetch the comment, see Credentials for more info
Click Triggers & Conditions and select Events
Add the Comment event
Select the project(s) to limit the scope and JQL if needed.
Save the action
Click create button again
Select parent: Comment Receiver
Select template application/json
Click Create
Go to the tab Triggers & Conditions
Click on Parent section
Enter the json path $.public
Select operator to be =
Enter the value; true
Configure the request to post data to the external system
When this is done you will have a structure like this;
Comment Receiver (this will receive the event and lookup the latest comment)
Send public comment to external system (this has a parent condition to check for the public flag)