2 answers
- 10-1
Hi Moogambigai, As mentioned in the support ticket after testing the following script and confirming that it works properly I am posting the solution here as well in case other members of our community encounter similar issues.
Outgoing sync:
if(issue.project == "ProjectKey"){ replica."Affected Programs 2" = issue."Affected Programs 1" }else{ replica."Affected Programs 1" = issue."Affected Programs 2" }
Incoming sync:
Option 1: if(replica.project.key == "ProjectKey1"){ def defaultOption = nodeHelper.getOptions(issue, "Affected Programs 2", ["DefaultValue"]) def options = nodeHelper.getOptions(issue, "Affected Programs 2", replica."Affected Programs 2".collect { it -> it.value }).findAll { it != null} if(options == null || options.size() == 0) { issue.customFields."Affected Programs 2".value = defaultOption } else { issue.customFields."Affected Programs 2".value = options } } if(replica.project.key == "ProjectKey2"){ def defaultOption = nodeHelper.getOptions(issue, "Affected Programs 1", ["DefaultValue"]) def options = nodeHelper.getOptions(issue, "Affected Programs 1", replica."Affected Programs 1".collect { it -> it.value }).findAll { it != null} if(options == null || options.size() == 0) { issue.customFields."Affected Programs 1".value = defaultOption } else { issue.customFields."Affected Programs 1".value = options } } Option 2: if(replica.project.key == "ProjectKey1"){ def defaultOption = nodeHelper.getOptions(issue, "Affected Programs 2", ["DefaultValue"]) issue.customFields."Affected Programs 2".value = nodeHelper.getOptions(issue, "Affected Programs 2", replica."Affected Programs 2".collect { it -> it.value }).findAll { it != null} ?: defaultOption } if(replica.project.key == "ProjectKey2"){ def defaultOption = nodeHelper.getOptions(issue, "Affected Programs 1", ["DefaultValue"]) issue.customFields."Affected Programs 1".value = nodeHelper.getOptions(issue, "Affected Programs 1", replica."Affected Programs 1".collect { it -> it.value }).findAll { it != null} ?: defaultOption }
Kind regards.
EzequielAdd your comment... - 10-1
Hi Moogambigai G R ,
Could you please try the getOption method, and let me know if it does not comply with your requirement?
Thank you,
Ashar
- Moogambigai G R
I have tried with getoption, its throwing error and its a multi select type field.
Requirement is if the values matches both side, it should sync that value, if not default values should sync.
Attached support zip. exalate_support_5.3.1-j8_8.20.6_20220711-025716.zip
Regards,
Moogambigai
- Moogambigai G R
Hi Ashar,
Is there any update?
Regards,
Moogambigai
- Moogambigai G R
Hi Ashar,
Is there any update on my above comment?
Regards,
Moogambigai
- Ariel Aguilar
Hi Moogambigai,
You can try something like in the following example:
issue.customFields."A".value = replica.customFields."B".value ?: "Default Value"
Kind regards,
Ariel
- Moogambigai G R
Thanks for the update. Please find below are the results i'm getting,
Local connection:
outgoing:
replica.customFields."10134" = issue.customFields."10134" //Affected Programs // OEM Affected Programs
Incoming:
issue.customFields."17401".value = replica.customFields."10134".value ?: "Alexandra"
10134 -Project A multiselect type field
17401 -Project B multiselect type field
Scenario 1:
Same values available in both side:
Here I have selected "carroll,canayon" in 10134 field and synced the record and values are synced perfectly
Scenario 2:
One value has available in both side, one non-value selected:
Selected Brilliance,Carroll in 10134 field and synced the record, its emptied the field in destination records and not setting default value as "Alxendra"
Scenario 3:
Non-matched values selected:
Selected Brilliance in 10134 field and synced the record, its emptied the field in destination records and not setting default value as "Alxendra"
- Ariel Aguilar
Hi there,
If you try:
issue.customFields."17401".value = replica.customFields."10134".value ?: ["Alexandra"]
Kind regards,
Ariel
- Moogambigai G R
Thanks for the update, I have tried above method, still no luck.
Both side same values is there only its sync, if values didn't match its cleared the existing value and not setting default value.
See the below history images both local and remote issues.
Regards,
Moogambigai
- Ariel Aguilar
Hi there,
And if you do:
issue.customFields.
"17401"
.value = replica.customFields.
"10134"?
.value ?: [
"Alexandra"
]
Kind regards,
Ariel
- Moogambigai G R
I have tried below one also and tried to replaced the field name instead of custom id. Nothing working.
issue.customFields.
"17401"
.value = replica.customFields.
"10134"?
.value ?: [
"Alexandra"
]
Regards,
Moogambigai
- Ariel Aguilar
This is not expected, if you try the following:
def defaultOption = nodeHelper.getOptions(issue, "17401L", ["Alexandra"]) issue.customFields."17401".value = replica.customFields."10134"?.value ?: defaultOption
Kind regards,
Ariel
- Moogambigai G R
I have tried above method also, but result is same, if values is not matched in local side, its not setting default value, its setting null.
If its possible, can we setup a meeting to resolve this issue.
Regards,
Moogambigai G R
- Ariel Aguilar
Hi Moogambigai,
Please submit a support request to our Service Desk directly to investigate for a possible bug.
Or just send an e-mail to support@exalate.com. This will create an issue on our JIRA Service Desk allowing for further tracking.
Kind regards,
Ariel
Add your comment...
Hi Team,
We have a scripted connection for project A and Project B in local instance and below are the example configuration.
We have Multi List type field and some values only matching in both sides, Need a functionality like if any of the not available values in project B field is selected in Project A while syncing A->B default value to be set.
Example
Project A ->Have “Alder” value
Project B → Not have “Alder” Value
If I synced A->B --->I have to set default value, if value is not present otherwise it will set the same value as A in B Project.
Regards,
Moogambigai G R
Hi Team,
Is there any update on above question?
Regards,
Moogambigai G R