Sync Zendesk-> Jira from Dropdown to Cascading style

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


Want to Sync from Zendesk to Jira

Scenario 1: Atleast the selection from Zendesk should go to the Jira parent box

  1. Zendesk Fields - “User Roles ZD” which is a Multi-select dropdown

2. Jira Fields - “User Roles Jira” which is a Select List (cascading)

Scenario 2: Selection from ZD should reflect in Jira first Box

  1. Zendesk Fields - “questions” which is a Single-select dropdown

2\. Jira Field\-  "question" which is a Select List (cascading)


Answer by Syed Majid Hassan on 09 June 2023

Try something like this:

def testMap = [
    "yes" : "Yes",
    "no" : "No"
    ]
issue.customFields."XYZ".value = nodeHelper.getOption(issue, "XYZ", testMap[replica.customFields."FIELD_NAME_FROM_ZD"?.value?.value])

XYZ is the Jira field name!

Thanks

Majid


Comments:

Syed Majid Hassan commented on 13 June 2023

I believe the nodeHelper requires the field name. Something worth remembering for future config!

I am glad it worked though!

Answer by Shaleen Kukreti on 12 June 2023

Hi Syed Majid Hassan it worked now, the only thing I did is instead of numeric values of the field in Incoming and outgoing, I replace everything with actual text and it worked.

Outgoing- Zendesk

replica.customFields.“Is this blocking an active or impending study visit?” = issue.customFields.“Is this blocking an active or impending study visit?” //Is this blocking an activity?

Incoming -Jira

//Is this blocking an activity?
def blockMap = [“yes_bug_blocking_study”:“Yes”, “no_bug_not_blocking_study”:“No”]
issue.customFields.“Is this blocking an active or impending study visit?”.value = nodeHelper.getOption(issue, “Is this blocking an active or impending study visit?”, blockMap[replica.customFields.“Is this blocking an active or impending study visit?”?.value?.value])


Answer by Shaleen Kukreti on 09 June 2023

I use the same code, now the Error is gone, but the field is not populating in Jira


Comments:

Syed Majid Hassan commented on 11 June 2023

Unfortunately, it is not possible to troubleshoot this here. Can you please check the remote replica to ensure that the expected data is arriving from the other side? If it is, can you please try to hard code a value in the Incoming script and try to go backwards from there to work out where the config is failing?

Thanks

Majid

Answer by Shaleen Kukreti on 09 June 2023

Hi Syed Majid Hassan

From my above mention Scenarios, 1st one works fine, but 2nd is not

When I use the below code, I am getting Error.

Outgoing from Zendesk :

Incoming in Jira:

def blockMap = [“yes_bug_blocking_study”:“Yes”, “no_bug_not_blocking_study”:“No”]
if (replica.customFields.“13637516636557”?.value?.size()>0) //line 40
issue.customFields.“12388”.value = nodeHelper.getOption(issue, “Is this blocking an active or impending study visit?”, blockMap[replica.customFields.“13637516636557”?.value[0]?.value])

ERROR

Remote replica I checked from Jira, its showing the value is coming.


Answer by Syed Majid Hassan on 09 June 2023

Hi,

I have tested both your scenarios out by using the following code:

ZD Outgoing:

replica.customFields."Supported Browsers" = issue.customFields."Supported Browsers"

Jira Incoming:

def testMap = [
    "chrome" : "Chrome",
    "safari" : "Safari"
    ]
if (replica.customFields."Supported Browsers"?.value?.size()>0)
    issue.customFields."Browser".value = nodeHelper.getOption(issue, "Browser", testMap[replica.customFields."Supported Browsers"?.value[0]?.value])

Here is a video explanation of the issue.

Please let me know if you have any questions.

Please mark the answer as accepted if this works for you.

Thanks

Majid


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