Features used to implement the example
Example 1: Creating a Jira Service Desk internal comment
SINCE VERSION 2.2
There are two different ways to do it:
Once created a comment (e.g., using "New comment" virtual field), you can use virtual field "Last comment's visibility restriction" for setting visibility restriction. You should write on this field value "internal" or "public" (without double quotes) for setting JSD (Jira Service Desk) comment's visibility.
A more direct way to do it is simply by adding string ": {visibility=internal}" or ": {visibility=public}" at the end of your comment's body when creating a comment with "New comment" or when editing a comment with "Last comment".
This is an example of the second option:
Text to be parsed in the example is: This is an internal comment.:{visibility=internal}
And here is the resulting comment:
You can also use the name of a group or the name of a project role as value of optional parameter visibility(i.e., ": {visibility=jira-developers}" or ": {visibility=Managers}"), and the visibility will be set for entered group or project role.
Other examples of that functions
Write field on linked issues or sub-tasks
- Add and remove a single or a set of items from multi valued fields
- Automatically become watcher of every issue blocking an issue assigned to you
- Automatically close resolved sub-tasks when parent issue is closed
- Automatically resolve an epic when all its stories are resolved
- Compose dynamic text by inserting field values in a text template
- Copy "Due date" into a date type custom field in a linked issue if it's greater than current issue's "Due date"
- Copy attachments from one issue to another
- Create a comment in sub-tasks when parent transitions
- Creating a Jira Service Desk internal comment
- Creating a Jira Service Desk internal comment on linked issues
- Execute transition in epic
- Make linked issues, sub-tasks and JQL selected issues progress through its workflows
- Moving sub-tasks to "Open" status when parent issue moves to "In Progress"
- Sum sub-task's "Time Spent" (work logs) and add it to a certain linked issue
- Transition sub-tasks when parent is transitioned
- Add and remove a single or a set of items from multi valued fields
- Compose dynamic text by inserting field values in a text template
- Creating a Jira Service Desk internal comment
- Creating a Jira Service Desk internal comment on linked issues
- Make linked issues, sub-tasks and JQL selected issues progress through its workflows
- Moving sub-tasks to "Open" status when parent issue moves to "In Progress"
- Parse Email adresses to watchers list
- Set priority for issues that have been in a certain status for longer than 24 hours
- Transition linked issues in currently active sprint
- Transition only a sub-task among several ones
- Using project properties to calculate custom sequence numbers
- Writing a comment to blocked issues when blocking issues are resolved
- Compose dynamic text by inserting field values in a text template
- Creating a Jira Service Desk internal comment
- Creating a Jira Service Desk internal comment on linked issues
Example 2: Copy transition's comment as new comment to a linked issue
What should I do if I want to copy the comment from the actual issue from Field "Transition's comment - [Text]" to the linked issue into the field "New comment - [Text]? How can I add the visibility to the role "Users"?
You can do it using Write field on linked issues or sub-tasks post-function with the following configuration:
Text to be parsed in the example is:
%{00127} : {visibility=Users}
Note that
Example 3: Conditional execution of a post-function depending on comment visibility restriction
Any way to use this in the conditional execution of a post function? if a comment is internal, send an email to someone? or verify the comment is not internal? that type of thing. Thank you.
Assuming that your condition is on comment entered in the transition, you can use boolean expressions like these:
%{00127} != null AND %{00130} = "Internal"
%{00127} != null AND %{00130} != "Internal"
%{00127} != null AND %{00130} = "Public"
Note that %{00127} is field code for Transition's comment, and %{00130} is field code for Last comment's visibility restriction.