Questions for Confluence license has expired.

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

Workaround for worklog jira cloud bug

 
2
1
0

Hello,
we are migrating projects between two different Jira cloud instances (in the source we have Tempo Timesheet, in the destination we have Clockwork but that does not matter) and we have a problem about worklogs due to this bug from Atlassian:
https://jira.atlassian.com/browse/JRACLOUD-72006
since Exalate is not a "slow human" but is sending different worklogs on the same issue quickly, we face the situation where, all the worklogs are correctly posted in the destination issue, but the time spent field on issue level is not showing the right total value (again, due to the Atlassian bug).

We are now asking your help to workaround this bug...

This is currenlty the part of the incoming script about worklogs:

issue.workLogs = workLogHelper.mergeWorkLogs(issue,replica,

{ w ->

w.author = nodeHelper.getUserByEmail(w.author?.email) ?: nodeHelper.getUserByFullName(w.author?.displayName.substring(w.author?.displayName.lastIndexOf(' ') + 1)) ?: defaultUser if(w.updateAuthor != null)

w.updateAuthor = nodeHelper.getUserByEmail(w.updateAuthor?.email) ?: nodeHelper.getUserByFullName(w.updateAuthor?.displayName.substring(w.updateAuthor?.displayName.lastIndexOf(' ') + 1)) ?: defaultUser

})

(Note: we needed to use substring to get only the lastname split by the firstname, otherwise your .getUserByFullName was matching "Claudio Menetti" also with "Claudio Somethingelse" and this I think is a bug on your end...)

The question for you are:

  • is there any way to fit into the lamba expression a kind of "sleep(100)" to workaround the Atlassian bug?
  • otherwise, may I do something like foreach wl in replica.worklogs and then something like: { sleep(100) worklogHelper.addWorklog(wl.author, wl.date, wl.hours, wl.description, etc...) }

Thanks in advance for you help, BR
Claudio

    CommentAdd your comment...

    1 answer

    1.  
      2
      1
      0

      Did you try it?

      1. Claudio Menetti

        Hello Francis Martens (Exalate) what are you asking me exactly if I tried?

        I tried sleep(100) in the .mergeWorkLogs lambda expression but Exalate doesn't allow me to save the groovy since probably the sintax is not correct.

        But I did not try the foreach + .addWorklog since I don't know exactly how to start with the foreach.

        I can have a try but a working groovy example would be really appreciated, using any of the two way.

        Thanks

      2. Francis Martens (Exalate)

        What was the error when you tried the sleep function.
        Can you also add the code snippet?

      3. Claudio Menetti

        Hello Francis Martens (Exalate) now I have direct access to this cloud instance and I can provide you deeper info...


        The error in the code was caused by setting the sleep(100) before the w->.  Moving it in the next line, Exalate accepted the code change and we did a test.


        But the test was not good (sad) we get the same outcome: some worklog created did not update correctly the time spent field on issue level.

        Maybe even if the Exalate groovy script execution correctly perform the sleep (and we tried also with sleep 1000), Exalate commit to Atlassian REST just in the end of the groovy execution?


        And, even worst, we also miss some worklog entry, seems some get lost in the cloud...


        Thanks in advance, BR

      4. Francis Martens (Exalate)

        Maybe even if the Exalate groovy script execution correctly perform the sleep (and we tried also with sleep 1000), Exalate commit to Atlassian REST just in the end of the groovy execution?


        That is the case ... so the sleep is not a solution


        Throttling the requests from Exalate to Jira cloud is not supported.
        This is a headscratch ...

      5. Claudio Menetti

        Hi Francis Martens (Exalate) 

        We can have a try with exporting the worklogs, fit them into a proper csv, and importing with native Jira import, but I suppose we will fall into the same Atlassian bug if we import more than one worklog on the same issue at the same time.


        Do you believe can we manage somehow with a kind of addWorklog(missingWorklogs.first) and repeat exalating issue up to the number of worklogs we have in the source instance?

        I just take a look on your worklogHelper methods and I cannot find anything similar, but for comments if I remember correctly, you provide a way to get only "addedComments" or "missingComments" or so.


        Then we also have the problem of fixing the timespent value on issue level... do you know if there is any way to update this field manually to the correct value of the sum of the worklogs (after importing all the worklogs)?


        Thanks again for your help!

      6. Francis Martens (Exalate)

        Is this a migration scenario?

      7. Claudio Menetti

        yes, it is. Jira cloud to Jira cloud.

        When completed previous instance will not be used anymore.

      8. Francis Martens (Exalate)

        I would escalate this to Atlassian.
        There is a problem with the REST call, it doesn't look like that this will be solved soon - so the cloud support team should be able to provide a workaround.

      9. Claudio Menetti

        ok thanks, if you get any relevant answer thanks in advance to let me know.

        in the meantime we will continue with our "manual" workaround.

        BR 

      CommentAdd your comment...