2
1
0

Hi

We've found a problem between exalate and Automation for Jira.
In our use case, exalate sync a instance with Jira Service Desk and an instance with Jira Software. We've discovered our problem in the next case:


When a issue is commented on Jira Service Desk, the issue get sync using exalate.On Software, we have an automation which, when the issue is commented updates the labels field. Our problem is when Automation updates the issue, Exalate has not finished the Sync, and sometimes, when the Sync finish, updates again the label, deleting the value introduced with automation.

We're looking to fix that, as the other option is to buy automation for Service Desk instance, but we think we will have the same problem.

On what instance: Jira Data Center 8.5.3

    CommentAdd your comment...

    1 answer

    1.  
      1
      0
      -1

      Our problem is when Automation updates the issue, Exalate has not finished the Sync


      What are the conditions which trigger the automation rule?

      1. Jorge Jerez Ibáñez

        As I said: "when the issue is commented updates the labels field"

        So comment is the trigger

      2. Francis Martens (Exalate)

        We checked internally.
        On Jira server, Exalate is not generating events when 'pairing' an issue (this is the operation which create an issue), and in case of updates, events are generated by jira.


        To test this out (we can be wrong of course), I added a custom script listener using the script runner - printing out the generated events


        So when pairing - no event is generated
        When syncing a comment - an issue comment is generated.

        Bottomline - we are currently clueless where the problem is incepted.

      3. Jorge Jerez Ibáñez

        The event "Issue commented" is generated 100% (Automation is being executed).
        The problem becomes when the automation edit the issue when exalate is still doing the sync. Automation add a value to a field, but sometimes this fields is not sync and exalate sync it before Automation edit it, so the value written by automation just disappears. 

        Could you try to test our use case? 

      4. Francis Martens (Exalate)

        Another customer raised a similar problem where 2 events are generated when doing a comment + transaction in a single script.

        We are investigating.

      5. Jorge Jerez Ibáñez

        Hi Francis


        Do we have any news about this? 

      6. Francis Martens (Exalate)

        We have a scenario allowing to reproduce the problem - further investigating.

      7. Jorge Jerez Ibáñez

        Hi Francis Martens (Exalate)


        Any news? 


        We're going to use Exalate on a new customer and we're afraid about facing issues with Automation as it is a usually used plugin on Jira Server. 


      8. Jorge Jerez Ibáñez

        Hi Francis Martens (Exalate)


        Out customer still waiting for this as they need to use automation for fix some problems. Do we have any good news? 

      9. Francis Martens (Exalate)

        The problem is still outstanding.  It looks like a difficult problem because fixing it, is creating a regression in an other use case.  :headscratch:

      10. Jorge Jerez Ibáñez

        If we can help you in any way, feel free to ask 

      11. Francis Martens (Exalate)

        Thanks for the offer.
        It is pretty internal

      12. Francis Martens (Exalate)

        Hi Jorge Jerez Ibáñez


        We were discussing the case today.
        One of the workarounds is to remove any update of the labels from the incoming script
        Avoid assigning to issue.labels

        Not sure if this helps - let me know


      13. Jorge Jerez Ibáñez

        I could be a way to resolve the problem.
        I'll talk about this with our customer but I don't think it will good for us as sometimes labels are added on  Jira Service Desk and they need to be sync. 

      14. Francis Martens (Exalate)

        The statement


        issue.labels = replica.labels


        is going to overwrite all the labels.
        If you need to merge the labels, a more specific logic needs to be handed


        For instance following snippet might be a help

        def a = [ 1, 2, 3, 4 ]
        def b = [ 2, 4]
        
        
        println a + b
        println a  + b.findAll{! a.contains(it)}



        Try it out on https://groovyconsole.appspot.com/

        It results in

      15. Jorge Jerez Ibáñez

        So we can use these statement into the Exalate script? 

      16. Jorge Jerez Ibáñez

        Would this work?

        issue.labels = issue.labels + replica.labels.findAll{! a.contains(it)}


        We can't test it actually 

      CommentAdd your comment...