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

Listener Work Started On Issue event doesn't works on some API

    Details

    • Type: Bug
    • Status: Triage
    • Priority: Trivial
    • Resolution: Unresolved
    • Affects Version/s: 5.5.5, 5.6.2
    • Fix Version/s: None
    • Component/s: Listeners
    • Labels:
      None
    • Critical Points:
      0.5

      Description

      Steps to Reproduce it

      1. Configure Work Started On Issue event on the post-function.
      2. Configure custom listener with the script below:
        import com.atlassian.jira.component.ComponentAccessor
        import com.atlassian.jira.issue.MutableIssue
        import com.atlassian.jira.event.type.EventDispatchOption
        def currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
        
        def im = ComponentAccessor.getIssueManager();
        def i = event.issue
        def userManager = ComponentAccessor.getUserManager();
        MutableIssue issueToChange = im.getIssueObject(i.id)
        def user = userManager.getUserByName(currentUser.name)
        
        def iType = i.issueType.name
        
        log.warn "====================Work Started event running"
        
        log.warn "iType: $iType"
        
        if(iType == "Bug")
        { 
            issueToChange.setDescription("hmm3") 
            issueToChange.setSummary("hello3")
            
            
            log.warn "Update Issue Description"
            
            im.updateIssue(currentUser, issueToChange, EventDispatchOption.DO_NOT_DISPATCH, false) 
        }
        
        log.warn "====================Work Started event end"
        
      3. Results

      Note

      • The script works on Script Console
      • The script works on Issue Updated event

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            jloong John Chin Loong
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated: