1
0
-1

Hi,

I want to configure the following via Exalate connections:

everytime the assignee will be changed in an issue, the assignee of the replica issue should be set to the default user "Exalate".


We don't want to synchronize the assignees because of the many notifications of their projects the assignee will getting too many notifications. Only the notifications for the issue where the update is "original" executed is important for the user. The user shouldn't get notiications from the updates of the replica issue which will be done by exalate sync.


So how I can set a default assignee?



    CommentAdd your comment...

    3 answers

    1.  
      1
      0
      -1

      Hi Ariel,


      this is my config and it works!


      if (!firstSync && !replica.assignee.equals(previous?.assignee)) {
        issue.assignee = nodeHelper.getUserByEmail("com.exalate.jiranode@connect.atlassian.com")
      }


      Thank you a lot!

      1. Ariel Aguilar

        Happy to hear that worked for you!

        Kind regards,

        Ariel

      CommentAdd your comment...
    2.  
      2
      1
      0

      Hi there, 
      Maybe you can try:

      if (!firstSync && !replica.assignee.equals(previous?.assignee)) {
        issue.assignee = nodeHelper.getUserByEmail("admin@company.com")
      }

      Let me know if that helps,
      Kind regards,

      Ariel

        CommentAdd your comment...
      1.  
        1
        0
        -1

        Hi Ariel Aguilar ,


        now we want to assign all assignees between a JSM Project and a Jira Software Project. The problem is that if the assignee doesn't have a JSM license he/she isn't assignable for the JSM issue and the sync will failed.

        Is it possible to catch up this failure?

        I want to sync every assignee between these projects. If the user can't be assigned because of missing jsm-license or is not assignable by the permission scheme, the default user "Exalate" should be the assignee.

        I've tried it with this configuration but it doesn't work:

        def defaultUser = nodeHelper.getUserByEmail("com.exalate.jiranode@connect.atlassian.com")
        issue.assignee = nodeHelper.getUserByEmail(replica.assignee?.email) ?: defaultUser



        Regards

        Duc

        1. Ariel Aguilar

          Hi Duc,

          If you just need to have a reference of the assignee, have you considered just to set a custom field for assignee?

          Kind regards,

          Ariel

        2. Duc

          Hey Ariel,

          thank you for the quick reply! We need the sync of the assignee because we still have users who have a valid license and working with the field assignee. For all users who don't have a jsm license and are not assignable in the jsm issue, they don't need to be assignee in the jsm ticket because they only work in the Jira software issue.

          Regards

          Duc

        3. Ariel Aguilar

          Hi Duc,

          I see, for Jira Cloud we have the method isUserAssignable, may be you can try this:

          def assignee = nodeHelper.getUserByEmail(replica.assignee?.email)
          if(nodeHelper.isUserAssignable(issue.projectKey, assignee)){
              issue.assignee = assignee
          }else{
              issue.assignee = nodeHelper.getUserByEmail("com.exalate.jiranode@connect.atlassian.com")
          }


          Kind regards,

          Ariel

        4. Duc

          I've tried the following:

          • Jira Software issue: change assignee to an user without jsm-license
          • JSM issue: assignee won't be changed and get this error:



          unfortunately I still get this error. Do you have any other idea?

        5. Ariel Aguilar

          Could you look for the old errors, go to the 3 dots menu, ignore related sync, and retry the operation? You may check if there is any extra line of code doing issue.assignee = replica.assignee 

          Kind regards,

          Ariel

        CommentAdd your comment...