Set user "Exalate" as default assignee for replica issue

Originally asked by Duc on 12 January 2022 (original question)


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?


Answer by Duc on 14 January 2022

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!


Comments:

Ariel Aguilar commented on 14 January 2022

Happy to hear that worked for you!

Kind regards,

Ariel

Answer by Ariel Aguilar on 13 January 2022

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


Answer by Duc on 19 January 2022

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


Comments:

Ariel Aguilar commented on 19 January 2022

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

Duc commented on 19 January 2022

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

Ariel Aguilar commented on 19 January 2022

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

Duc commented on 19 January 2022

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?

Ariel Aguilar commented on 19 January 2022

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

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.