1
0
-1

Dear Sir

Does the exalate support to unexalate the connected issue auto for specified connection when I close the issue? If yes, how to do it?


We are using the Jira server version.


Best regards,

Helen Li

    CommentAdd your comment...

    1 answer

    1.  
      1
      0
      -1

      Hi Helen, 


      Sure, this could be accomplished with the following snippet.


      Incoming Sync:

      if (replica.status.name == "Closed") {
        // stop sync if remote issue has been closed.
        final def _syncInitService = com.atlassian.jira.component.ComponentAccessor
          .getOSGiComponentInstanceOfType(com.exalate.api.trigger.ISyncInitiationService.class)
        _syncInitService.unexalate(issueKey.id as Long)
        return
      }


      The snippet above would unexalate the issue as soon as the remote issue is changed to the closed status. Alternatively, if you want to unexalate the issue when the status is changed to closed locally, you can use the following snippet:


      if (issue.status.name == "Closed") {
        // stop sync if remote issue has been closed.
        final def _syncInitService = com.atlassian.jira.component.ComponentAccessor
          .getOSGiComponentInstanceOfType(com.exalate.api.trigger.ISyncInitiationService.class)
        _syncInitService.unexalate(issueKey.id as Long)
        return
      }


      Let me know if this is sufficient for you!


      Thanks,


      Ariel


      1. Benjamin Kiene

        Hi,


        Would the same be possible on Jira Cloud?


        Thank you,


        Ben

      2. Salma Nairi

        Hi Ariel Aguilar 

        i m trying to use your code but i had this error although the cast is done

        Script error for issue "ISSUEKEY". Details: No signature of method: com.exalate.trigger.SyncInitiationService.unexalate() is applicable for argument types: (java.lang.Long) values: [153828] Possible solutions: unexalate(java.lang.String).


        could please advice me

        thanks

      3. Salma Nairi
          // stop sync if remote issue has been closed.
          final def _syncInitService = com.atlassian.jira.component.ComponentAccessor
            .getOSGiComponentInstanceOfType(com.exalate.api.trigger.ISyncInitiationService.class)
          _syncInitService.unexalate(issueKey.id as String)
        this code is working with String cast

        i note that if remote issue is exalated with another issue by another connection , this connection
        is unexalate too ?
        how can we indicate only a current connection ( connection used from issue not replica

        )tthanks
      4. Salma Nairi

        hi

        sorry , i re tested this code but it didn't work

        where should i put it in incoming rule, on top  ?

      CommentAdd your comment...