# Many Zendesk Tickets To One Devops WorkItem

**URL:** <https://community.exalate.com/t/many-zendesk-tickets-to-one-devops-workitem/5205>\
**Category:** General Questions\
**Tags:** zendesk, devops, migrated\_question\
**Created:** [November 4, 2024, 7:49am UTC](https://community.exalate.com/t/many-zendesk-tickets-to-one-devops-workitem/5205 "2024-11-04T07:49:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![xl8bot](https://dub1.discourse-cdn.com/flex018/user_avatar/community.exalate.com/xl8bot/32/324_2.png) [@xl8bot](https://community.exalate.com/u/xl8bot)\
**Post date:** [November 4, 2024, 7:49am UTC](https://community.exalate.com/t/many-zendesk-tickets-to-one-devops-workitem/5205/1 "2024-11-04T07:49:51Z")

</div>

_Originally asked by Mathieu Lepoutre on 11 May 2022 [(original question)](https://oldcommunity.exalate.com/questions/42838091)_

* * *

How can I assign multiple support tickets which are created in Zendesk, to a single ticket in Azure Devops?

* * *

---

<div class="post-metadata">

**Author:** ![xl8bot](https://dub1.discourse-cdn.com/flex018/user_avatar/community.exalate.com/xl8bot/32/324_2.png) [@xl8bot](https://community.exalate.com/u/xl8bot)\
**Post date:** [November 4, 2024, 7:49am UTC](https://community.exalate.com/t/many-zendesk-tickets-to-one-devops-workitem/5205/2 "2024-11-04T07:49:52Z")

</div>

_Answer by Mathieu Lepoutre on 11 May 2022_

To do this, you would need to populate a customField value in Zendesk, with the desired workItem from Azure Devops.

After making a custom Field called “Key”, we populate it with the workItem number.  
In the outgoing sync in Zendesk, please write this line of code:

```auto
//Send a Custom Field value
replica.customFields."Key" = issue.customFields."Key"

```

Now to the other side, we want the multiple support tickets (in this case) to be exalated to a single workItem.

We will do this through a REST API call. After populating the REST API with the field of the Zendesk Custom Field, we can pick up the id of the WorkItem.

In the incoming script in Azure Devops, add these lines of code;

```auto
def remoteKey = replica.customFields."Key"?.value
//debug.error("${remoteKey}")

if(remoteKey){
      boolean correct = false; 
	  def localWorkItem = httpClient.get("/_apis/wit/workitems/${remoteKey}?api-version=6.0", correct)
       workItem.id = localWorkItem?.id
       return;
}

```

The incoming processor is getting the local workItem id out of the call, and assigning it to the workItem id.

* * *

---

<div class="post-metadata">

**Author:** ![xl8bot](https://dub1.discourse-cdn.com/flex018/user_avatar/community.exalate.com/xl8bot/32/324_2.png) [@xl8bot](https://community.exalate.com/u/xl8bot)\
**Post date:** [November 6, 2024, 7:50am UTC](https://community.exalate.com/t/many-zendesk-tickets-to-one-devops-workitem/5205/3 "2024-11-06T07:50:23Z")

</div>

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