# How to unexalate specific connection with custom field condition

**URL:** <https://community.exalate.com/t/how-to-unexalate-specific-connection-with-custom-field-condition/4870>\
**Category:** General Questions\
**Tags:** jiraserver, unexalate, migrated\_question\
**Created:** [November 4, 2024, 7:28am UTC](https://community.exalate.com/t/how-to-unexalate-specific-connection-with-custom-field-condition/4870 "2024-11-04T07:28:46Z")\
**Posts on this page:** 2\
**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:28am UTC](https://community.exalate.com/t/how-to-unexalate-specific-connection-with-custom-field-condition/4870/1 "2024-11-04T07:28:46Z")

</div>

_Originally asked by Salma Nairi on 24 September 2021 [(original question)](https://oldcommunity.exalate.com/questions/37552709)_

* * *

Hi

we need to unexalate specific connection with custom field condition

if local issue has customfield value equal to “Shynchro Stopped” , unexalate this issue

if remote issue has more than one connection , we need to keep them and unexalte only a specific connection

Thanks

* * *

#### Comments:

> **Salma Nairi commented on 27 September 2021**
>
> > i tried this code but it didn’t work
> 
> [Does the exalate support to unexalate the connected issue auto for specified connection when I close the issue?](https://oldcommunity.exalate.com/questions/20124627/does-the-exalate-support-to-unexalate-the-connected-issue-auto-for-specified-connection-when-i-close-the-issue-)_(old community)_

> **Daniel Carvajal commented on 01 October 2021**
>
> > Hi Salma Nairi
> 
> We are working to find a solution to this problem, we will be replying soon.
> 
> Thanks

> **Salma Nairi commented on 01 October 2021**
>
> > Daniel Carvajal , thanks

> **Ariel Aguilar commented on 01 October 2021**
>
> > Hi Salma,
> 
> The following article was updated since the method changed:
> 
> [https://docs.idalko.com/exalate/x/IZArAQ](https://docs.idalko.com/exalate/x/IZArAQ)
> 
> This should work to get the value from the custom field, and unexalate for all connections:
> 
> ```auto
> if (replica.customFields."Custom Field".value == "Shynchro Stopped"){
> final def _syncInitService = com.atlassian.jira.component.ComponentAccessor
> .getOSGiComponentInstanceOfType(com.exalate.api.trigger.ISyncInitiationService.class)
> _syncInitService.unexalate(issueKey.id as String)
> return
> }
> 
> ```
> 
> Then if you want to do it by single connection, you might want to think on using scriptrunner and check this post:
> 
> [Unexalate connection via scriptrunner](https://oldcommunity.exalate.com/display/exacom/questions/25071187/unexalate-connection-via-scriptrunner)_(old community)_
> 
> Kind regards,
> 
> Ariel

> **Salma Nairi commented on 02 October 2021**
>
> > Thanks
> 
> i already tried using script runner but i had exceptions some methods can’t be imported
> 
> ```auto
> I did not find the time to solve them  
> thanks
> 
> ```

---

<div class="post-metadata">

**Author:** ![Majid](https://dub1.discourse-cdn.com/flex018/user_avatar/community.exalate.com/majid/32/343_2.png) [@Majid](https://community.exalate.com/u/Majid)\
**Post date:** [December 4, 2024, 9:20am UTC](https://community.exalate.com/t/how-to-unexalate-specific-connection-with-custom-field-condition/4870/2 "2024-12-04T09:20:39Z")

</div>


