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

Users can't view Attachments added after the 50th Viewable Comment to them on Customer Portal

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Highest Highest
    • 4.2.0, 3.16.4
    • 3.15.3, 3.16.2, 4.0.2, 4.1.0
    • Customer Portal
    • None

      Issue Summary

      When a user views an SD ticket from Customer Portal, JSD only shows attachments from the first 50 comments that are viewable by the user:

      • For a customer, this means the first 50 public comments
      • For an agent, this means the first 50 comments regardless of public or internal, as long as the agent can view them all from Jira Issue View

      Attachments added to any comment after the 50th viewable one can't be viewed or downloaded as JSD throws a 403 Forbidden error.

      Steps to Reproduce

      1. Create a new SD ticket
      2. Add 49 public comments and 1 internal comment to it, without any attachments
      3. Add comment #51 as public, with an attachment
        This can be done by either agent or customer from either Jira or Portal. Observe these behaviors:
        • From Portal, customer can view/download the attachment, as it's in the 50th comment viewable by him
        • From Portal, agent can't view/download the attachment, as it's in the 51st comment viewable by him
        • From Jira, agent can view/download/manage the attachment normally
      4. Add comment #52 as public, with a different attachment that has a different file name
        This can be done by either agent or customer from either Jira or Portal. Observe these behaviors:
        • From Portal, customer can't view/download the attachment, as it's in the 51st comment viewable by him
        • From Portal, agent can't view/download the attachment, as it's in the 52nd comment viewable by him
        • From Jira, agent can view/download/manage the attachment normally

      Expected Results

      Attachments should be able to be viewed/downloaded from Portal regardless of where it appears.

      Actual Results

      A 403 Forbidden error is thrown for attachments added after the 50th viewable comment relative to the user.

      Workarounds

      Workaround 1 - Recommended

      1. As an agent, find a public comment that is among the first 50 comments (including both public and internal comments)
      2. Edit that comment and add wiki markup for the attachment

      This way, the attachment is seen by JSD as appearing in 1 of the first 50 comments viewable by both customers and agents. Both customers and agents should then be able to view it from Portal.

      Workaround 2 - only applicable to customers

      As an agent, convert older public comments to internal so that the attachment now appears in one of the first 50 public comments. Customers should then be able to view it.

      This won't help agents as internal comments are still viewable by them.

      Workaround 3 - only applicable to agents

      View the ticket in Jira instead of Portal.

            [JSDSERVER-6304] Users can't view Attachments added after the 50th Viewable Comment to them on Customer Portal

            I have a similar question to the previous related to Fix Version 4.1.2, which doesn't appear in the official list of latest available hotfix versions. Is there any additional information on when this release will occur?

            Chris Martin added a comment - I have a similar question to the previous related to Fix Version 4.1.2, which doesn't appear in the official list of latest available hotfix versions. Is there any additional information on when this release will occur?

            Fix Version/s: ...3.16.4, ...

             

            Where to download SD v. 3.16.4 obr ? Anyone?

            As far as I can see, the latest available version is 3.16.3
            https://marketplace.atlassian.com/apps/1213632/jira-service-desk/version-history 

            axxonadmin added a comment - Fix Version/s: ... ,  3.16.4 , ...   Where to download SD v. 3.16.4 obr ? Anyone? As far as I can see, the latest available version is 3.16.3 https://marketplace.atlassian.com/apps/1213632/jira-service-desk/version-history  

            Hi Drew, 

            As a said, it is "For those that are affected by this bug, but not having 50 comments on the issue".

            It was mi case, and I wanted to help sharing the solution I found.

            To check if it is your case, just create a new comment linking the same file without any alias, and check if the previous alias link is working properly.

            Regards.

            Manuel Jesús Morión Barea added a comment - Hi Drew,  As a said, it is "For those that are affected by this bug, but not having 50 comments on the issue". It was mi case, and I wanted to help sharing the solution I found. To check if it is your case, just create a new comment linking the same file without any alias, and check if the previous alias link is working properly. Regards.

            Drew Smith added a comment -

            Manuel thanks for the workaround you provided for the other pipe 403 error Atlassian had,  JSDSERVER-6082,  but I don't see this workaround providing any solution for this issue. The reason is simply once you get over 50 public facing comments the comment with an attachment, regardless of it being with an alias or not, will give a 403 error. Your Script when it creates another comment will still be a comment higher than 50, it doesn't add the attachment to a previous customer facing comment nor change an earlier customer facing comment to internal which are the workarounds that do work. If I am wrong or misunderstanding your comment my apologies.

            Drew Smith added a comment - Manuel thanks for the workaround you provided for the other pipe 403 error Atlassian had,   JSDSERVER-6082 ,   but I don't see this workaround providing any solution for this issue. The reason is simply once you get over 50 public facing comments the comment with an attachment, regardless of it being with an alias or not, will give a 403 error. Your Script when it creates another comment will still be a comment higher than 50, it doesn't add the attachment to a previous customer facing comment nor change an earlier customer facing comment to internal which are the workarounds that do work. If I am wrong or misunderstanding your comment my apologies.

            Hi,

            For those that are affected by this bug, but not having 50 comments on the issue, I want to share the workaround I have develop for this bug JSDSERVER-6082.

            I discovered that if the linked file is also linked in another comment without alias, the links with alias works.

            With that info, I have created a Script Runner Listener on comment creation and comment edition of Service Desk projects.

            If a public comment is created or edited, and that comment contains file links with alias, the script cretes a new comment only with the linked files, but this time without alias:

            import com.atlassian.jira.bc.issue.comment.property.CommentPropertyService
            import com.atlassian.jira.component.ComponentAccessor
            import com.atlassian.jira.event.issue.IssueEvent
            import com.atlassian.jira.issue.comments.Comment
            import groovy.json.JsonSlurper
            import java.util.regex.*
            
            final SD_PUBLIC_COMMENT = "sd.public.comment"
            
            def event = event as IssueEvent
            def user = event.getUser()
            def comment = event.getComment()
            def commentPropertyService = ComponentAccessor.getComponent(CommentPropertyService)
            
            def isInternal = { Comment c ->
              def commentProperty = commentPropertyService.getProperty(user, c.id, SD_PUBLIC_COMMENT)
              .getEntityProperty().getOrNull()
            
              if (commentProperty) {
                def props = new JsonSlurper().parseText(commentProperty.getValue())
                props['internal'].toBoolean()
              } else {
                null
              }
            }
            
            if (comment && !isInternal(comment)) {
              String txt = comment.getBody()
            
              def files = []
              Pattern filepat = Pattern.compile("\\[.*\\|\\^(.*)\\]")
              Matcher m = filepat.matcher(txt)
              while (m.find()) {
                files << "[^"+m.group(1)+"]"
              }
            
              if(files){
                def commentManager = ComponentAccessor.getCommentManager()
                commentManager.create(issue, comment.getAuthor(), files.join("\n"), false)
              }
            }

            This way, the original alias link works ok.

            I hope this may help.

            Regards.

            Manuel Jesús Morión Barea added a comment - - edited Hi, For those that are affected by this bug, but not having 50 comments on the issue, I want to share the workaround I have develop for this bug  JSDSERVER-6082 . I discovered that if the linked file is also linked in another comment without alias, the links with alias works. With that info, I have created a Script Runner Listener on comment creation and comment edition of Service Desk projects. If a public comment is created or edited, and that comment contains file links with alias, the script cretes a new comment only with the linked files, but this time without alias: import com.atlassian.jira.bc.issue.comment.property.CommentPropertyService import com.atlassian.jira.component.ComponentAccessor import com.atlassian.jira.event.issue.IssueEvent import com.atlassian.jira.issue.comments.Comment import groovy.json.JsonSlurper import java.util.regex.* final SD_PUBLIC_COMMENT = "sd. public .comment" def event = event as IssueEvent def user = event.getUser() def comment = event.getComment() def commentPropertyService = ComponentAccessor.getComponent(CommentPropertyService) def isInternal = { Comment c -> def commentProperty = commentPropertyService.getProperty(user, c.id, SD_PUBLIC_COMMENT) .getEntityProperty().getOrNull() if (commentProperty) { def props = new JsonSlurper().parseText(commentProperty.getValue()) props[ 'internal' ].toBoolean() } else { null } } if (comment && !isInternal(comment)) { String txt = comment.getBody() def files = [] Pattern filepat = Pattern.compile( "\\[.*\\|\\^(.*)\\]" ) Matcher m = filepat.matcher(txt) while (m.find()) { files << "[^" +m.group(1)+ "]" } if (files){ def commentManager = ComponentAccessor.getCommentManager() commentManager.create(issue, comment.getAuthor(), files.join( "\n" ), false ) } } This way, the original alias link works ok. I hope this may help. Regards.

            Hello, I agree with Eric, and this bug is causing significant disruptions to our operations.

            Max Ehrmann added a comment - Hello, I agree with Eric, and this bug is causing significant disruptions to our operations.

            This has affected a critical reporting project in our organization. Please resolve. Thanks.

            Brad Taplin added a comment - This has affected a critical reporting project in our organization. Please resolve. Thanks.

            Like David, we are also really suffering from this issue. Most of our communications with external customers involve more than 50 public comments and the attachments contain essential information regarding the request. Please prioritize!

            Eric Czernizer added a comment - Like David, we are also really suffering from this issue. Most of our communications with external customers involve more than 50 public comments and the attachments contain essential information regarding the request. Please prioritize!

            axxonadmin added a comment -

            >Priority:  Low

            That's all I needed to know before even considering moving to service desk.

            axxonadmin added a comment - >Priority:  Low That's all I needed to know before even considering moving to service desk.

            David added a comment -

            We really suffer from this error now. We cannot follow up CR's with our customers since attachments won't show. 

            A ticket system that cannot handle 50 comments on an issue..? I know if was April 1st yesterday, but still remains April 2nd..

            David added a comment - We really suffer from this error now. We cannot follow up CR's with our customers since attachments won't show.  A ticket system that cannot handle 50 comments on an issue..? I know if was April 1st yesterday, but still remains April 2nd..

              ashubovych moofoo (Inactive)
              dkoh Danson (Inactive)
              Affected customers:
              34 This affects my team
              Watchers:
              48 Start watching this issue

                Created:
                Updated:
                Resolved: