Synchronize comments from JS to JSM respecting original comment restrictions
The need: synchronize comments from Jira Software to Jira Service Management and respect comment restrictions from the source issue
Currently, two behaviors exist regarding comment synchronization in JSM projects:
Either all comments are private and no customer can see them
Or all comments are public
This depends on the option "Make Jira Software comments public in Customer Portal":
It could be useful to make this behavior adaptive, depending on the comment restriction in the source project. This would result in the following behavior:
If a comment has restrictions in the source project, then it should be synchronized as internal in the JSM project
If a comment has no restrictions in the source project, then it should be synchronized as public in the JSM project
The solution: Set up two recipes and exclude the appropriate comment types
The solution is to implement two recipes:
- The 1st recipe will synchronize all comments as public in the JSM project, and the comment type "Restricted comments" will be excluded.
- The 2nd recipe will synchronize all comments as internal in the JSM project and the comment type "Comments visible to everyone" will be excluded.
Tutorial
Prerequisites
A Copy & Sync recipe called "Copy tickets from JS to JSM" has been created, activated, and is available on issue SUP-1.
Configuration steps
1st recipe
1 - As a Jira administrator, navigate to the "Elements Copy & Sync Cloud" administration menu
2 - Go to the "Recipes" tab:
3 - Edit the "Copy tickets from JS to JSM" recipe:
- Go to the "Target" tab:
- Select a link in the "Create link to source issue" field, as follows:
This is essential for the second recipe (of type Synchronization) to work, as this recipe type is based on Jira issue links.
- Select a link in the "Create link to source issue" field, as follows:
- Go to the "Content" tab:
- Enable the "Synchronize comments" option and configure it as follows:
- Enable the "Advanced comments options" option and configure it as follows:
This way, the recipe will only copy unrestricted comments as public in the JSM project.
- Save your changes
2nd recipe
1 - Create a new recipe of type "Synchronization":
2 - Configure it as follows:
- The "Source" and "Target" tabs can be configured in the same way as the 1st recipe, so that both recipes will run in the same context.
- Go to the "Content" tab:
- Enable the "Synchronize comments" option:
- Enable the "Advanced comments options" option and configure it as follows:
This way, the recipe will only copy restricted comments as internal in the JSM project.
- Enable the "Synchronize comments" option:
- Go to the "Triggers" tab, and select the link type you have set in the first recipe:
- Save your changes
For already existing tickets, don't forget to activate synchronization using the "List synchronizable issues" and "Activate sync" functions, as mentioned here.