1
0
-1

Attempting to pass the Group Assigned from Jira to Zendesk so that the ticket in Zendesk can get reassigned. Current code i am using is:

replica.customFields."Group Assigned" = issue.customFields."Group Assigned".value

But getting this error

Unexpected error occurred. The customfield `Group Assigned`
was assigned to `value=[
{name=Customer Service, self=https://atlassian.net/rest/api/2/group?groupname=Customer+Service}

]
class=java.util.ArrayList`, but it should have been set to a custom
field object Generate an exalate support.zip file and contact support.

When i try

replica.customFields."Group Assigned" = issue.customFields."Group Assigned"

I get nothing sent.

  1. Ariel Aguilar

    Hi David,

    There are a couple of important details that you will need to share as we help you out. In Zendesk, is it a ticket field or user field? What type of field is it ? (Drop-down, Multi-select, Checkbox?) What is the incoming script for Jira? What type of field is it? (Drop-down, Multi-select (single choice), Checkbox etc…)

    Kind regards,

    Ariel

  2. David Oosting

    It is a ticket drop-down with multi-select.  But looking at the Incoming and Outgoing, I am not seeing anything under customField except {}


    Dave

  3. Ariel Aguilar

    In Zendesk, is it a drop-down? And in Jira, multi select single choice? If you are sending from Jira to Zendesk. The Jira Outgoing should be:

    replica.customFields."Group Assigned" = issue.customFields."Group Assigned"

    Kind regards.

    Ariel

  4. David Oosting

    Jira Local:

      "customFields": {
          "Group Assigned": {
            "id": 10056,
            "name": "Group Assigned",
            "uid": "10056",
            "type": "UNHANDLED",
            "value": [
              {
                "name": "Customer Service",
                "self": "https://atlassian.net/rest/api/2/group?groupname=Customer+Service"
              }
            ]
          }
    Jira Remote:
    "customFields": {},

    Zendesk Local:
    "customFields": {},
    Zendesk Remote:
     "customFields": {
          "Group Assigned": {
            "id": 10056,
            "name": "Group Assigned",
            "uid": "10056",
            "type": "UNHANDLED",
            "value": [
              {
                "name": "Customer Service",
                "self": "https://atlassian.net/rest/api/2/group?groupname=Customer+Service"
              }
            ]
          }
  5. David Oosting

    So trying to get customFields."Group Assigned".value.name is not working.


  6. Ariel Aguilar

    Hi David,

    Without confirming Jira Outgoing, Jira Incoming, Zendesk Outgoing, Zendesk Incoming scripts and the type of fields for both, it would be hard to continue.

    Kind regards,

    Ariel

  7. David Oosting

    Right now im just attempting to get the the if statement to work.


    if(issue.customFields."Group Assigned".value.name == "Customer Service") {
        issue.labels += nodeHelper.getLabel("customer_service")
    }

  8. David Oosting

    It does not. 


    No such property: name for class: com.google.gson.JsonArray 

  9. David Oosting

    the .value equals an array


    [{"name": "Customer Service","self": "https://atlassian.net/rest/api/2/group?groupname=Customer+Service"}]

    and dot notation is not picking name from that array.
  10. Ariel Aguilar

    Hi David,

    If you do:

    if(replica.customFields."Group Assigned".value.name.contains("Customer Service")) {
        issue.labels += nodeHelper.getLabel("customer_service")
    }

    Kind regards,

    Ariel


  11. David Oosting

    No such property: name for class: com.google.gson.JsonArray 


  12. David Oosting

    Hey Ariel, any update on this? 

  13. Ariel Aguilar

    Hi David,

    If you change it to:

    if(replica.customFields."Group Assigned".value.get(0).name == "Customer Service") {
        issue.labels += nodeHelper.getLabel("customer_service")
    }

    Let me know if this works for you,

    Kind regards,

    Ariel

  14. David Oosting

    if(replica.customFields."Group Assigned".value.get(0).name == "Customer Service")  showing Not TRUE.


    customFields": {
          "Group Assigned": {
            "id": 10056,
            "name": "Group Assigned",
            "uid": "10056",
            "type": "UNHANDLED",
            "value": [
              {
                "name": "Customer Service",
                "self": "https://atlassian.net/rest/api/2/group?groupname=Customer+Service"
              }
            ]
          }
  15. Ariel Aguilar

    Hi David,

    Can you try this:

    if(replica.customFields."Group Assigned".value.find()?.toString()?.name?.contains("Customer Service")){
        issue.labels += nodeHelper.getLabel("customer_service")
    }

    Kind regards,

    Ariel

  16. David Oosting

    That doesnt work also.  No such property: name for class: java.lang.String →


    if(replica.customFields."Group Assigned".value.find()?.toString()?.name?.contains("Customer Service"))


CommentAdd your comment...

1 answer

  1.  
    2
    1
    0

    Ok just it is really similar but this is it:

    if(replica.customFields."Group Assigned".value.find()?.name?.toString()?.contains("Customer Service")){
        issue.labels += nodeHelper.getLabel("customer_service")
    }
    1. David Oosting

      Worked... thanks Ariel.

    2. David Oosting
      if(replica.customFields."Group Assigned".value.find()?.name?.toString()?.contains("Customer Service")){
          issue.labels += nodeHelper.getLabel("customer_service")
      }

      Logic Works. Now to get the Group Assigned changed in zendesk.
    3. Ariel Aguilar

      You're welcome. I have edited to make it more easy to read and understand for everybody.

      Kind regards,

      Ariel

    4. Ariel Aguilar

      Can you be more specific based on what you are looking forward to have the Group Assigned in Zendesk?

      Thanks,

      Ariel

    5. David Oosting

      Now that the Logic is sound, I now need to assign the ticket to the "Customer Support" group.  Drop down from:



      to:

    6. Ariel Aguilar

      Hi David,

      You can maybe add the following:

      if(replica.customFields."Group Assigned".value.find()?.name?.toString()?.contains("Customer Service")){
          issue.labels += nodeHelper.getLabel("customer_service")
      	issue.assignee = nodeHelper.getUserByUsername("Customer Support")
      }

      Kind regards,

      Ariel

    7. David Oosting

      Remember the Field is a multidropdown for the Assignee,  so we are just assigning to the Parent Group.


      Looking at the Outgoing


      "assignee": {
            "key": "5d9240324258550c23a16c4c",
            "active": true,
            "email": "doosting@bet.works",
            "displayName": "David Oosting"
          }
      So this assignee looks like the requestor.
    8. Ariel Aguilar

      Hi David,

      Sorry, I thought it was a regular assignee. I would consider instead of using Exalate for that to manually create a trigger in Zendesk with some conditions and then on actions you can specify the group.

      Kind regards,

      Ariel

    9. David Oosting

      Im thinking that too.  Easiest way around it since Multi-Dropdowns have not been the easiest to assign.

    10. Ariel Aguilar

      It is achievable through Exalate as well, but it will require some advanced configuration using Rest API calls. Then, on the other hand, I think setting up this Zendesk trigger it is more practical. Just let me know.

      Kind regards,

      Ariel


    CommentAdd your comment...