1 answer
- 210
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") }
- David Oosting
Worked... thanks Ariel.
- 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. - Ariel Aguilar
You're welcome. I have edited to make it more easy to read and understand for everybody.
Kind regards,
Ariel
- Ariel Aguilar
Can you be more specific based on what you are looking forward to have the Group Assigned in Zendesk?
Thanks,
Ariel
- David Oosting
Now that the Logic is sound, I now need to assign the ticket to the "Customer Support" group. Drop down from:
to:
- 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
- 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. - 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
- Ariel Aguilar
Something like:
- David Oosting
Im thinking that too. Easiest way around it since Multi-Dropdowns have not been the easiest to assign.
- 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
Add your comment...
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.
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
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
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:
Kind regards.
Ariel
Jira Local:
So trying to get customFields."Group Assigned".value.name is not working.
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
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")
}
It does not.
No such property: name for class: com.google.gson.JsonArray
the .value equals an array
Hi David,
If you do:
Kind regards,
Ariel
No such property: name for class: com.google.gson.JsonArray
Hey Ariel, any update on this?
Hi David,
If you change it to:
Let me know if this works for you,
Kind regards,
Ariel
if(replica.customFields."Group Assigned".value.get(0).name == "Customer Service") showing Not TRUE.
Hi David,
Can you try this:
Kind regards,
Ariel
That doesnt work also. No such property: name for class: java.lang.String →