Ability to set visibility when writing comments in linked issues (part of JSD projects)

Issue #175 resolved
Aggelos Paraskevopoulos [Cententia] created an issue

When writing a "new comment" on linked issues that happen to be of Service Desk type project we need a way to select the type ("visibility") of comment. This is actually handled by a comment entity ("CommentProperty") property (propertyKey="sd.public.comment".) Now the default behavior is to add the comment as "public" one, even if the executing user is a collaborator.

<EntityProperty id="10439" entityName="CommentProperty" entityId="10274" propertyKey="sd.public.comment" created="2015-09-21 07:16:26.794" updated="2015-09-21 07:16:26.794" value="{&quot;internal&quot;:&quot;true&quot;}"/>
<EntityProperty id="10440" entityName="sd.comment.property" entityId="10274" propertyKey="sd.public.comment" created="2015-09-21 07:16:26.826" updated="2015-09-21 07:16:26.826" value="{&quot;internal&quot;:true}"/>

Cheers, AP

Comments (24)

  1. Fidel Castro Armario repo owner

    Hi Aggelos,

    Next version of the plugin (2.2) will implement this improvement. It will be released in a month approximately.

    Regards,

    Fidel

  2. Fidel Castro Armario repo owner

    Hi Aggelos,

    I have made available version 2.2_beta_20 which supports setting visibility for JSD comments.

    You have two different ways to do it:

    1. 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.

    2. 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:

    conf-0.png

    And here is the resulting comment:

    result.png

    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.

  3. Aggelos Paraskevopoulos [Cententia] reporter

    Kudos Fidel,

    works great! Tried the first method, as I think it's the only one that can be used for posting a comment on linked issues, right? The second would work on workflow post-functions acting on the issue at hand.

    Cheers, AP

  4. Aggelos Paraskevopoulos [Cententia] reporter

    Oh cool, we can use %{Transition's comment} when composing the ephemeral string and add the visibility attribute {visibility=internal}

    Thanks Fidel.

  5. Stefan Bittner Account Deactivated

    Hi Fidel,

    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"?

    Cheers Stefan

  6. Stefan Bittner Account Deactivated

    Wow, Fidel!

    It works and you safed my weekend. Great and such a quick answer.

    Thanks a lot Stefan

  7. Aggelos Paraskevopoulos [Cententia] reporter

    Fidel the unsung JIRA hero. Saved a lot of weekends for us too :)

  8. Brian Budniewski

    @fcarmario 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.

  9. Fidel Castro Armario repo owner

    Assuming that your condition is on comment entered in the transition, you can use boolean expressions like these:

    1) A comment has been entered in transition, and the visibility is Internal.

    %{00127} != null AND %{00130} = "Internal"
    

    2) A comment has been entered in transition, and the visibility is not Internal.

    %{00127} != null AND %{00130} != "Internal"
    

    3) A comment has been entered in transition, and the visibility is public.

    %{00127} != null AND %{00130} = ""
    

    Note that %{00127} is field code for Transition's comment, and %{00130} is field code for Last comment's visibility restriction.

  10. Aggelos Paraskevopoulos [Cententia] reporter

    Brian, if we keep praising Fidel's work he's going to raise the add-on price very soon :) Jokes aside the add-on rocks.

  11. Stefan Bittner Account Deactivated

    Hi Fidel, if you look above, you were able to help me with the problem of the visibility of a Transition comment. Your solution does completely what I need and it works great: 2017-12-13 21_15_50-Microsoft Edge.png

    Unfortunately and more by luck I found out, that this post function will always write a comment to the linked issue. If there was a comment in the transition the text of this comment will be written in a new comment in the linked issue = Correct! But if there is no transition comment, a new but empty comment will be written which makes no sense and will confuse the users = Incorrect. 2017-12-13 21_26_16-Microsoft Edge.png

    Is there a chance only to write a comment to the linked issue if there is a transition comment?

    Cheers Stefan

  12. Fidel Castro Armario repo owner

    Hi @the_bit,

    You should use the following boolean expression at parameter Conditional execution:

    %{00127} != null
    

    where %{00127} is field code for Transition's comment.

  13. Log in to comment