ZD to Jira - multiselect dropdown Sync

Originally asked by Shaleen Kukreti on 08 June 2023 (original question)


ZD:- I have a custom field “Customer name” which is a “Multiselect dropdown”

Jira:- I have a custom field “Customer Name2” which is a “Select List (Multiple Choice)”

You can select multiple choice from both, but I cannot Sync or send fields from ZD to Jira or vice versa. Can’t find anything in the documentation about it. Please let me know if there is any query to be used for this case.


Comments:

Tomas Vaitkevicius commented on 30 January 2024

Hello, do you maybe know how to implement it that the other way around too?

Jira “Select List (Multiple Choice)” => Zendesk “multi-select dropdown”

I would appreciate a lot if you could help with this

Syed Majid Hassan

Shaleen Kukreti

Here is the original post Scrip for sync - Jira “Select List (Multiple Choice)” values => Zendesk “multi-select dropdown” values (old community)

Answer by Syed Majid Hassan on 08 June 2023

Hi Shaleen,

I have just tested this successfully using the following:

Outgoing on ZD:

replica.customFields."Customer name" = issue.customFields."Customer name"

Incoming on Jira:

issue.customFields."Customer Name2".value = replica.customFields."Customer name".value.collect{c -> nodeHelper.getOption(issue, "Customer Name2", c.value)}

This works well as long as the values match on both sides. In your case the values would not match as the ZD side send the API name. So you will need a mapping of something similar to:

Outgoing on ZD:

Incoming on Jira:

def custMap = [
    "value1_from_zd" : "jira_value1",
    "value2_from_zd" : "jira_value2"
    ]
issue.customFields."ZD Customer".value = replica.customFields."Customer".value.collect{c -> nodeHelper.getOption(issue, "ZD Customer", custMap[c.value])}

The documentation I used to solve this is here.

Here is a quick video demonstration of the solution in action:

Please let me know if this resolves the issue.

Thanks

Majid


Answer by Tomas Vaitkevicius on 30 January 2024

Hello, do you maybe know how to implement it that the other way around too?

Jira “Select List (Multiple Choice)” => Zendesk"multi-select dropdown"

I would appreciate a lot if you could help with this

Syed Majid Hassan

Shaleen Kukreti

Here is the original post Scrip for sync - Jira “Select List (Multiple Choice)” values => Zendesk “multi-select dropdown” values


Answer by Shaleen Kukreti on 08 June 2023

Thanks Syed Majid Hassan . I change the last line to

issue.customFields.“ZD customer”.value = replica.customFields.“Jira customer”.value.collect{c -> nodeHelper.getOption(issue, “ZD customer”, custMap[c.value])}

and it worked, Thank you :smile:


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