1
0
-1

For two synced issues, I need to find a way to show which issue was the one with the last update (the one who triggered sync the last time).
Considering a field "Last updated By" [ Instance 1 | Instance 2 ] at both issues.
The use case is two teams collaborating and they need a way to show who has the next action. Workflows are not compatible.
A thought was to set a local value at outgoing sync, but that seems not possible.
Any suggestions?

    CommentAdd your comment...

    1 answer

    1.  
      1
      0
      -1

      You could send over the updated field:

      //Outgoing:
      replica.updated = issue.updated

      And then update a custom field of type datetime on the incoming:

      issue.customFields."Remote updated".value = replica.updated


      Let me know if this works.

      1. Peter Friberg

        Just to clarify: Suppose you mean that the Outgoing part is on "Instance 1", and the incoming part is on "Instance 2".

        I can't see how the user would have benefit of that, unless we can compare the "Instance 1" "Remote updated" with "Instance 2" "Remote updated"


        What about this (I don't dare to test it. Risk for infinite loops?):

        Instance 1 incoming:

        issue.customFields."last updated by".value = "Instance 2"

        ...

        syncHelper.syncBackAfterProcessing()


        Instance 2 incoming:

        issue.customFields."last updated by".value = "Instance 1"

        ...

        syncHelper.syncBackAfterProcessing()

      2. André Leroy-Beaulieu Castro

        Hi Peter,


        You can have the Outgoing line on both instances:


        replica.updated = issue.updated


        then on Incoming on both sides you can have this logic:


        if (replica.updated > issue.updated) {
           issue.customFields."Remote updated".value = replica.updated
        }


        so that it only updates the field when the updated date received is newer than the current one in the custom field. 


        Let me know if this would work for you!


        Thanks,


        André

      CommentAdd your comment...