Questions for Confluence license has expired.

Please purchase a new license to continue using Questions for Confluence.

Is there a way to tell Exalate to NOT SYNC based off of the value of a field?

 
1
0
-1

Hello,
Is there a way to tell Exalate to NOT SYNC based off of the value of a field?


When we set the field to NO we don't want anything that we are setting, changing, adding to be sync'd at all...even if we set it to YES afterwards. long story short any activity that we do while the custom field is set to NO doesn't need to be pushed to Side B ever.


For example, if we add an attachment or comment while 'custom_field' is set to NO it shouldn't go to side B. When we set that to Yes is still doesn't need to go to side B. Only everything after we set it back to YES.


Thanks!
-Dewayne

    CommentAdd your comment...

    1 answer

    1.  
      1
      0
      -1

      Hi Dewayne,

      It means that you need to enhance your outgoing sync}
      First of all - stopping the sync can be done by adding a condition to the outgoing sync

      // at the beginning of the outgoing sync
      if (issue.customFields."shouldSync" == "False") {   //   an empty replica, will make exalate ignore the change   return}


      But then whenever the 'shouldSync' is set to true, you still want to ignore changes made while the customfield was false.

      The challenge is to identify these changes.

      A suggestion is to review the issue.history.  Assume following history




      This is provided to the outgoing script in the changeHistory.
      Following snippet shows how to get to the details

      String result = ""
      String sep=""
      issue.changeHistory.each {
          it.changeItems.each { 
              result += sep + it.field + ":" + it.from + " -> " + it.to 
              sep=", "
          }
          
      }



      provides

      History = labels: -> label, description:If not here -> description 3


      Of course, attachments and comments are not included in the history.  This needs a separate filtering
      By inspecting the history, one can find the moments that the customfield has been set to 'no sync'

      If you check the comment object here, it has the created and updated timestamps. Based on that information, one can filter out the appropriate objects


      replica.comments = issue.comments.filterAll { isAllowed(comment) } 


      'isAllowed' is something that needs to be crafted.

        CommentAdd your comment...