Uploaded image for project: 'Jira Service Management Data Center'
  1. Jira Service Management Data Center
  2. JSDSERVER-1505

Comments added to issues by addons are listed as internal by default

      NOTE: This bug report is for JIRA Service Desk Server. Using JIRA Service Desk Cloud? See the corresponding bug report.

      Summary

      JSD should not consider comments without the sd.public.comment attribute as internal comments, but as public comments. Only comments with the entity property set to false should be considered private.

      Steps to Reproduce

      1. Create a Service Desk enabled project;
      2. Create a customer request;
      3. Add a comment as an external AC or a P2 addon

      Expected Results

      The comment should be added as public.

      Actual Results

      the issue becomes shown as an Internal comment which is not accurate

      Notes

      I suspect the reason this occurs is because the Comment did not have an entity property sd.public.comment which is what JSD seems to use to differentiate between internal and public comments.

          Form Name

            [JSDSERVER-1505] Comments added to issues by addons are listed as internal by default

            Andy Brook added a comment -

            see related JSD-3907

            Andy Brook added a comment - see related JSD-3907

            Andy Brook added a comment - - edited

            We're working on implementing this right now, however there seem to be a few blockers, for example, we need to be able to create comments but stop events firing (JSD-3897). The Component API doesn't support that feature, so we can't actually use it.

            Andy Brook added a comment - - edited We're working on implementing this right now, however there seem to be a few blockers, for example, we need to be able to create comments but stop events firing ( JSD-3897 ). The Component API doesn't support that feature, so we can't actually use it.

            Andy Brook added a comment -

            I notice that the public component API's are not published on the Atlassian maven repo {{ https://maven.atlassian.com/content/groups/public/com/atlassian/servicedesk/jira-servicedesk-api/ }} Is this to be done at some point? I'm currently breaking open the JSD jar and manually installing the jira-servicedesk-api-3.1x.jar. Related to that, the JIRA Service Desk Development Guide seems to be just a copy of the standard JIRA page, it makes no reference to JSD specific dependencies (the instructions don't result in a skeleton with required JSD imports). I would have logged feedback on that page but the feedback form only allows Name/Email no content, and submit breaks with some random JSON issue.

            Andy Brook added a comment - I notice that the public component API's are not published on the Atlassian maven repo {{ https://maven.atlassian.com/content/groups/public/com/atlassian/servicedesk/jira-servicedesk-api/ }} Is this to be done at some point? I'm currently breaking open the JSD jar and manually installing the jira-servicedesk-api-3.1x.jar. Related to that, the JIRA Service Desk Development Guide seems to be just a copy of the standard JIRA page, it makes no reference to JSD specific dependencies (the instructions don't result in a skeleton with required JSD imports). I would have logged feedback on that page but the feedback form only allows Name/Email no content, and submit breaks with some random JSON issue.

            Andy Brook added a comment - - edited

            Nice! for cloud, we'll certainly be able to sue that. Regarding P2, is the creation of strictly public or private issues via the IssueService ever going to be possible? Using the JSD API for this would resolve this particular problem but have a very restrictive outcome for us. nm, I think we can roll this in!

            Andy Brook added a comment - - edited Nice! for cloud, we'll certainly be able to sue that. Regarding P2, is the creation of strictly public or private issues via the IssueService ever going to be possible? Using the JSD API for this would resolve this particular problem but have a very restrictive outcome for us. nm, I think we can roll this in!

            Hi! I have some good news on this:

            Atlassian Connect add-ons can new use the Service Desk REST API to create both public and internal comments (specified by the 'public' field in the request body). See the REST documentation for more info.

            Additionally, P2 add-ons can make use of ServiceDeskCommentService to create both public and internal comments:

            final ServiceDeskCommentCreateParameters publicComment =
                serviceDeskCommentService.newCreateBuilder()
                                         .author(user)
                                         .issue(customerRequest.getIssue())
                                         .publicComment(true)
                                         .body("This is a public comment")
                                         .build();
            serviceDeskCommentService.createServiceDeskComment(user, publicComment);
            
            final ServiceDeskCommentCreateParameters internalComment =
                serviceDeskCommentService.newCreateBuilder()
                                         .author(user)
                                         .issue(customerRequest.getIssue())
                                         .publicComment(false)
                                         .body("This is an internal comment")
                                         .build();
            serviceDeskCommentService.createServiceDeskComment(user, internalComment);
            

            Please note that, for both these methods, setting comment visibility depends on the calling user's permissions. For example, Agents can create either public or internal comments, Unlicensed users can only create internal comments, and Customers can only create public comments.

            Cheers,
            Trey Brisbane
            JIRA Service Desk team

            Trey Brisbane (Inactive) added a comment - Hi! I have some good news on this: Atlassian Connect add-ons can new use the Service Desk REST API to create both public and internal comments (specified by the 'public' field in the request body). See the REST documentation for more info. Additionally, P2 add-ons can make use of ServiceDeskCommentService to create both public and internal comments: final ServiceDeskCommentCreateParameters publicComment = serviceDeskCommentService.newCreateBuilder() .author(user) .issue(customerRequest.getIssue()) .publicComment( true ) .body( "This is a public comment" ) .build(); serviceDeskCommentService.createServiceDeskComment(user, publicComment); final ServiceDeskCommentCreateParameters internalComment = serviceDeskCommentService.newCreateBuilder() .author(user) .issue(customerRequest.getIssue()) .publicComment( false ) .body( "This is an internal comment" ) .build(); serviceDeskCommentService.createServiceDeskComment(user, internalComment); Please note that, for both these methods, setting comment visibility depends on the calling user's permissions. For example, Agents can create either public or internal comments, Unlicensed users can only create internal comments, and Customers can only create public comments. Cheers, Trey Brisbane JIRA Service Desk team

            KP added a comment - - edited

            This feature is actually added as of jira 7.1, right?

            https://docs.atlassian.com/jira-servicedesk/REST/latest/#servicedeskapi/request/{issueIdOrKey}/comment

            KP added a comment - - edited This feature is actually added as of jira 7.1, right? https://docs.atlassian.com/jira-servicedesk/REST/latest/#servicedeskapi/request/{issueIdOrKey}/comment

            Andy Brook added a comment -

            Thanks for the update Brad, this is hurting a lot , FYI, its still an issue in JIRA Service Desk 3.x

            Andy Brook added a comment - Thanks for the update Brad, this is hurting a lot , FYI, its still an issue in JIRA Service Desk 3.x

            Update on the progress of JSD REST API - 13 Oct 2015

            The JSD ecosystem team are actively working on REST / Java APIs to add public / private comments (and create customer requests). As a matter of policy we never say actual release dates or versions but I can say its quite advanced internally. We are working on the documentation publishing and final testing.

            Agents will have the ability to make public or private comments.

            Cheers
            Brad Baker
            JSD Architect

            ɹǝʞɐq pɐɹq added a comment - Update on the progress of JSD REST API - 13 Oct 2015 The JSD ecosystem team are actively working on REST / Java APIs to add public / private comments (and create customer requests). As a matter of policy we never say actual release dates or versions but I can say its quite advanced internally. We are working on the documentation publishing and final testing. Agents will have the ability to make public or private comments. Cheers Brad Baker JSD Architect

            I don't know how you aren't getting the comment tagged as internal, I just revalidated the scenario with JIRA 6.4.11 and JSD 2.5.6 also. Comments are 'public' as I create it and step through, but JSD comes in and stomps the comment private, despite the user making the comment being in the Service Desk Customers role.

            I just noticed JSD-2347 as well.

            Andy Brook added a comment - I don't know how you aren't getting the comment tagged as internal, I just revalidated the scenario with JIRA 6.4.11 and JSD 2.5.6 also. Comments are 'public' as I create it and step through, but JSD comes in and stomps the comment private, despite the user making the comment being in the Service Desk Customers role. I just noticed JSD-2347 as well.

            If JSD doesn't update the property at all, all good, use the code above to set the property to Private, if JSD overwrites (whatever it is) it to Public, that's a flip in behaviour and is going to cause problems that the code above can't fix, and I guess means the inverse problem would then be the case (I want to make some comments private and some not, rather than all public, or all private).

            Have you tried the code above to set private, what outcome? Meantime, I'll revalidate this with current vers.

            Andy Brook added a comment - If JSD doesn't update the property at all, all good, use the code above to set the property to Private, if JSD overwrites (whatever it is) it to Public, that's a flip in behaviour and is going to cause problems that the code above can't fix, and I guess means the inverse problem would then be the case (I want to make some comments private and some not, rather than all public, or all private). Have you tried the code above to set private, what outcome? Meantime, I'll revalidate this with current vers.

              Unassigned Unassigned
              cd3cc7134331 Andy Brook
              Affected customers:
              27 This affects my team
              Watchers:
              36 Start watching this issue

                Created:
                Updated:
                Resolved: