Uploaded image for project: 'SR for Jira - Development'
  1. SR for Jira - Development
  2. SRJIRA-2009

Automated SD Public comments

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Done
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: 4.3.6
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Sprint:
      Sprint 33 - Ends Sept 18, Sprint 34 - Ends Sept 25, Sprint 35 - Ends Oct 10
    • Epic Link:
    • Critical Points:
      0

      Description

      Automated comments created by Script Runner does not trigger Service Desk automation rule set for visibility Public.

      Steps to reproduce :

      • Create two projects, normal and Service desk.
      • In normal project setup WF post-function to comment linked issues.
      • Create issue in each project and link them according to the post-function.
      • Create ServiceDesk automation triggering on comment, with condition for Public comments only. Result may be for example to transition given SD issue.
      • Make sure that SD issue is in status where it may be transitioned by automation (i..e. # not Closed when you want to Close it)
      • Transition non-SD issue trough transition with our post-function SD Issue will be commented, but not transitioned.

      Use script

      import com.atlassian.jira.component.ComponentAccessor
      import com.atlassian.jira.util.json.JSONObject
      
      def issueManager = ComponentAccessor.getIssueManager()
      def issue = issueManager.getIssueObject("SDP-2") //replace it with a key in an issue in SD
      final SD_PUBLIC_COMMENT = "sd.public.comment"
      def commentManager = ComponentAccessor.getCommentManager()
      def user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
      def properties = [(SD_PUBLIC_COMMENT): new JSONObject(["internal": false])]
      
      commentManager.create(issue, user, "my external comment", null, null, new Date(), properties, true)
      

      Script console and listener work as expected. Via a post function it fails to trigger service desk's automation rule

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              dyelamos Daniel Yelamos [X] (Inactive)
              Reporter:
              tbatagiannis Thanos Batagiannis
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: