How can I synchronize the value of a field of the type 'multiple users' with the request participants custom field from Jira Service Desk?

Originally asked by Jose Antonio González García on 26 August 2021 (original question)


I want to synchronize a multiple user custom field from Jira Software project with the request participant custom field from Jira Service Desk.
I am using this:
replica.customFields.“Participantes” = issue.customFields.“Participantes de la solicitud”

But it doesn’t work because ‘Request participant’ custom field is not of user type.


Comments:

Andrii Markov commented on 26 August 2021

Hi Jose Antonio González García!

Can you please elaborate more about this question?:

1) What do you have in the incoming sync?

2) Are you getting any errors? If so, which side are you having the error on?

3) Do you mean by “multiple user custom field” the “Select list (multiple choices)” one?

Thanks,
Andrii

Jose Antonio González García commented on 26 August 2021

Well, I am synchronizing one project of Jira SD with other one of Jira Software. I need to synchronize the custom field ‘Participantes’ (multiple user selection custom field on Jira Software) with the custom field ‘Participantes de la solicitud’ (request participant from Jira SD). Connection is JSD_JSoftware.

Outgoing sync:
replica.customFields.“Participantes” = issue.customFields.“Participantes de la solicitud”.value.username

Incoming sync:
issue.customFields.“Participantes de la solicitud”.value.username = replica.“Participantes”

I am getting this error: Sync rules result validation error.
Details: Unexpected error occurred. The customfield `Participantes` was assigned to `value=[jjerez] class=java.util.ArrayList`, but it should have been set to a custom field object Generate an exalate support.zip file and contact support.

The purpose is to select users in the software project to be request participants in the Jira Service desk.

Thank you,
Jose

Andrii Markov commented on 26 August 2021

Hi Jose Antonio González García ,

Thank you for the update!
I have analysed your scripts and I think there should be more proper thing to be added in here:

Could I ask you please to try putting the following part of code:
Outgoing sync:
replica.customFields.“Participantes” = issue.customFields.“Participantes de la solicitud”

Incoming sync:
issue.customFields.“Participantes de la solicitud”.value = replica.customFields.“Participantes”?.value

Also, you can observe the configuration for your case in our documentation about syncing a custom field with multiple choices:

https://docs.idalko.com/exalate/display/ED/How+to+sync+custom+fields+with+options+in+Jira+on-premise#HowtosynccustomfieldswithoptionsinJiraon-premise-Selectlist(multiplechoices)

Please get back to us with any outcome you will get.

Kind Regards,
Andrii

Jose Antonio González García commented on 30 August 2021

Hi!
I tried to use your code and now I have this error:

Error Type:

Incoming script error

Error Creation Time:

2021-08-30 08:32:42.734

Error Detail Message:

Exception evaluating property ‘value’ for java.util.ArrayList, Reason: groovy.lang.MissingPropertyException: No such property: value for class: com.exalate.basic.domain.hubobject.v1.BasicHubUser

Regards,
Jose

Answer by Jose Antonio González García on 02 September 2021

Hi!!
Do you have any idea for resolving the last error?

Regards, Jose


Comments:

Andrii Markov commented on 07 September 2021

Could you please try the following one?:

Incoming sync

issue.customFields."Participantes de la solicitud".value = replica.customFields."Participantes"?.value

Kind Regards,
Andrii