I have a troubleshooting on my Outgoing synchronization and I don’t understand why ?
I only want synchronization when the SupportTeam = MyGroup (Group picker)
My trigger : project = myProject and SupportTeam = “MyGroup” My Outgoing :
I tried a lot of things :
if (!issue.customFields."SupportTeam".value == ["MyGroup"] && firstSync){
return;
// For the first sync use !issue == xxxx
}else if (issue.customFields."SupportTeam".value != ["MyGroup"] && !firstSync){
return;
// For next sync use issue != xxxx
}else{
replica.key = issue.key
replica.type = issue.type
replica.assignee = issue.assignee
SupportTeam is a Group Picker. I followed the documentation.
“Contains” doesn’t work.
The first Sync doesn’t work but if I comment my condition on the Outgoing : the issue sync this time. After if I set my condition. The sync works perfectly with this same issue and with this condition.
Thanks for raising this community question. To make sure that your trigger works accordingly, I would suggest trying it first in the Issue Search section of your Jira since it’s JQL and make sure that it is finding the issues that you expect it to find.
Besides that, if you want to return in the outgoing sync when the group picker field has that value, since it is a list, I would expect something like this to work:
if (!issue.customFields."SupportTeam".value.contains("MyGroup")) {
return;
}
Also make sure that you are using the custom field name exactly as it is defined in your Jira, the code above will only work if the field is called SupportTeam (without a space).