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

setAssignee doesn't get "noticed"

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Done
    • Priority: Major
    • Resolution: Support Request
    • Affects Version/s: 3.0.6
    • Fix Version/s: None
    • Component/s: None
    • Labels:
    • Environment:

      JIRA 6.3.4 - script runner 3.0.6

    • Critical Points:
      0

      Description

      Problem:

      I'm using Script Runner in a transition to assign the current user as the assignee when there's no one assigned, but when searching for this issue it doesn't appear in the result list.

      The script:
      MutableIssue myIssue = issue
      PermissionManager pm = ComponentAccessor.getPermissionManager()
      User currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
      ApplicationUser appUser = ApplicationUsers.from(currentUser)
      if (!myIssue.assigneeId) {
          if (pm.hasPermission(Permissions.ASSIGNABLE_USER, myIssue, appUser)) {
              myIssue.setAssignee(currentUser)
      		log.warn('--- post function --- assignissue.groovy --- new issue assignee >>> ' + currentUser.name)
          }
      }
      
      The result:

      The script works, because the user is assigned the issue, but when searching for all issues that this user has assigned it doesn't appear in the list.

      The search JQL:
       assignee in (currentUser())
      

      When I manually assign the issue to this user then the issue does appear in the search result.
      Am I doing something wrong? (the result I see on screen seems to work).
      Or is Script Runner failing somewhere?

        Attachments

          Activity

            People

            Assignee:
            jechlin Jamie Echlin
            Reporter:
            jacquesschoofs@hotmail.com Jacques
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: