Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

A helpful guide to automate comment copying across JSM, JSW, and JWM projects

This workaround aims to assist Jira Software (JSW) and Jira Work Management (JWM) projects that require communication with Jira Service Management (JSM) projects, which involves utilizing the Automation for Jira (A4J) feature to copy comments made between these projects.

At the moment, there are certain limitations in how the communication is made between JSM tickets and JSW or JWM tickets since JSM is primarily designed for customer interaction.

We do have some features related to this topic in our development backlog aimed at improving this as well:

Therefore, it's important to note that internal comments are exclusive to projects set up within the JSM product scope. Unfortunately, this feature is not available for JSW and JWM projects.

Workaround steps:

For the JSM project: 

Create an automation rule for when a comment is added to the ticket it will verify if the comment is external or internal, and then copy the comment to the linked ticket from a JSW or JWM project. You can create an IF condition to separate/distinguish the Internal or External comments, using the smart value below:

{{comment.properties."sd.public.comment".internal}} "equals" true or false
  • For example:
    Screenshot 2024-04-08 at 16.37.29.png

 Some tips

In order to automatically add the comment as a project role (in this example I used the "JSM & JSW Communication" custom project role, you can use other roles as you wish), you will need to add this project role to the project Comment Permissions and also add the Automation for Jira user to this project role, to do this go to View Project Roles of Automation for Jira user and add the specific project role (for me, the "JSM & JSW Communication" role) directly in the projects that you are using, or access directly via this link below (replace <yourinstance.atlassian.net> with the URL of your Atlassian cloud instance):

https://<yourinstance.atlassian.net>/secure/admin/roles/ViewUserProjectRoles.jspa?accountId=557058%3Af58131cb-b67d-43c7-b30d-6b58d40bd077
  • As you can see in the screenshot below:Screenshot 2024-04-08 at 17.23.50.png
  • Otherwise, the automation rule will fail with the message: "You are currently not a member of the project role: XXXXX. (commentLevel)"

If you choose to use a Group instead, I would recommend checking if your instance has Group & Project Roles enabled for Comment visibility, see below how to check this:

  • Check under JIRA Settings > System > General Configuration for "Comment visibility" and make sure it's set to "Groups & Project Roles" and not "Project Roles only"


For the JSW or JWM projects:

First, to access comment properties, you can use the {{comment}} smart value.

For instance, if you want to access the body of the comment, you can use {{comment.body}}. And, if the comment has properties like visibility, you can access them using {{comment.visibility}}.

For example, if you want to access the "type" field inside "visibility", you can use {{comment.visibility.type}}. Similarly, for "value" and "identifier" fields, you can use {{comment.visibility.value}} and {{comment.visibility.identifier}} respectively.

Therefore, in my example, I'm using the "JSM & JSW Communication" project role for internal comments, so the IF condition will be:

{{comment.visibility.value}} "equals" JSM & JSW Communication or Empty

 Extra tips

In order to avoid confusion with linked tickets, I recommend creating a specific type of link only for this use case. As demonstrated in my example, I utilized the "comments linked in" custom link type. For further details, please refer to the documentation provided below:

As in JSM we have the background color in yellow for internal comments, unfortunately this does not apply to restricted comments in JSW and JWM, we also have an item in our development backlog aimed at improving this as well:

Therefore, to ensure clarity between restricted and public comments within your team, I recommend customizing the restricted comments to appear in a distinct color. For example, I use the smart value below in my automation rule to show the comment text in red and the internal link to the original ticket where the comment was made:

[~accountid:{{comment.author}}] commented the following:
{quote}??{color:#de350b}{{comment.body}}{color}??{quote}
~Original comment made on [{{triggerIssue.key}}|{{triggerIssue.url}}]~

Or, as a workaround, you can use the panel macro. This will allow you to set a color for the background of your text. Here's how you can modify your smart value to include a yellow background:

{panel:bgColor=yellow}
[~accountid:{{comment.author}}] commented the following:
??{color:#de350b}{{comment.body}}{color}??
~Original comment made on [{{triggerIssue.key}}|{{triggerIssue.url}}]~
{panel}

But please be aware that the icon associated with the color macro will also appear in the copied comment, as you can see on the screenshot below (using red and yellow color as a example):Screenshot 2024-04-10 at 11.46.25.png

Therefore, if the icon isn’t a concern for your use case, you can utilize any HTML color name or hex code for the "bgColor" parameter. Here are some examples:

{panel:bgColor=red} // Red background
{panel:bgColor=blue} // Blue background
{panel:bgColor=green} // Green background
{panel:bgColor=yellow} // Yellow background
{panel:bgColor=#FF5733} // Orange background (using hex code)

Please remember that the color rendering may vary depending on the browser and the display settings of the user. 


This workaround will work as I demonstrate in the screen recording below:

4 comments

Matthew Challenger
Contributor
April 9, 2024

Very detailed and informational!

Like Bruno Altenhofen likes this
Tomislav Tobijas _Koios_
Solutions Partner
Solution Partners provide consulting, sales, and technical services on Atlassian products.
April 9, 2024

Interesting 👀 I think we've used something like this during one project implementation. Anyway, cheers for sharing!

One question though - is the official name for automation "Automation for Jira (A4J)" or "Jira automation"? Seen a couple of different discussions and answers lately so I was just wondering what's the proper name so I can write it down in our internal docs 😅

Like Bruno Altenhofen likes this
Bruno Altenhofen
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 12, 2024

Howdy @Tomislav Tobijas _Koios_ ,

This is an insightful question, and to be honest I reached out to some former Code Barrel employees to verify this information.

Therefore, "a4j" is what we affectionately referred to it as, remembering the old days. However, the current and more accurate term to use is "Jira Automation," which I will update accordingly in my articles.

Additionally, I've been informed that internally, it's already referred to as the "Automation Platform," so it's likely that this will become its new official name soon...

Thanks! :D

Alper Saglam _actioner_
Contributor
May 7, 2024

Good explanation, thank you. 

Like Bruno Altenhofen likes this

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events