Syncing work log entries

Originally asked by GHB on 19 May 2021 (original question)


Hi Guys,

I have installed your Exalate App in our Jira Service Management instance and in a trial version of Jira Service Management to see how your App is working. After this I configured a connection based on the Visual type, and added my credentials after which the connection is successfully created.

As I put the connection on manual sync, I have created a ticket and entered the issue key into exalate to sync. This works as expected.

All comments gets synced, but worklog is a different thing. I’m not sure how to configure Exalate to synchronize work log entries.


Comments:

Ariel Aguilar commented on 20 May 2021

HI GHB,

Could you please confirm you want to sync work log entries from Tempo?

Kind regards,

Ariel

GHB commented on 20 May 2021

I would like to sync the default Jira Cloud work log entries, meaning the time someone is working on an issue.

Ariel Aguilar commented on 20 May 2021

Hi GHB,

Since you are using a visual connection, you will need to add a script.

You can find more information on how to add a script here:

https://docs.idalko.com/exalate/x/ogXHAw

Note: When you add a script it comes with some example lines that you need to remove entirely.

Then, you just need to add the following snippet:

if (executionInstanceName == "B") { B.issue.workLogs = workLogHelper.mergeWorkLogs(B.issue, A.issue) }

Let me know if this works for you.

Kind regards,

Ariel

GHB commented on 24 May 2021

Ariel,

Thanks for your reply.

Do I need to make any changes to the snipplet? I’m asking since it’s not working. I tried to change the A and B to the instance keys and I see that it gets triggered but it’s just waiting. The status is WAITING_FOR_RESPONSE with a sync type of UPDATE.

Any suggestions?

GHB commented on 24 May 2021

UPDATE:

I have added the following snipplet (based on the original Ariel provided) and I see that the sync gets initiated and completed. Initiated because after a change an update is shown in the outgoing / incoming queue. Completed since it disappears without an error.

strangly enough there is no time added to the ticket, not from L → R and also not from R → L.

Ariel Aguilar commented on 24 May 2021

Hi GHB,

Could you please share what you have added? You will need to make sure the letters A and B are replaced according to the name compound showing on the connection name. Did you replace the letters?

Kind regards,

Ariel

GHB commented on 26 May 2021

I didn’t know that the letters A and B needed to be the same as the connection name(s), so I have changed the script as follows.

if (executionInstanceName == “ASD”) { ASD.issue.workLogs = workLogHelper.mergeWorkLogs(ASD.issue, NSD.issue) }

if (executionInstanceName == “NSD”) { NSD.issue.workLogs = workLogHelper.mergeWorkLogs(NSD.issue, ASD.issue) }

I gets triggered when adding a worklog entry, but get a permission denied error on the “TO” instance.

--

Impact:

Sync is not blocked

Error Type:

Permissions error

Error Creation Time:

May 26, 2021 09:47:51

Error Detail Message:

Could not access issue tracker when performing action: Adding worklog by user: Some(ghb@domain>) to issue with id 10027. Error(s):

Forbidden (403)

Encountered a "403 - Forbidden" error while loading this page.

--

GHB commented on 16 June 2021

Ariel Aguilar Do you have an idea what i’m missing here?

Ariel Aguilar commented on 21 June 2021

Hi GHB

When you create the connection, you are asked how do you want to name the local and remote instance. Then I understand your connection name is: ASD_to_NSD?

Also, I see there is a permission error. Could you please verify if you have proper permissions to work on the issue 10027? Please have a look to: https://docs.idalko.com/exalate/x/HIA7 and check if the proxy user has proper permissions. Let me know if this works for you.

Kind regards,

Ariel

GHB commented on 22 June 2021

Hi Ariel,

Does this mean we need to create an user named Exalate? For as far as I know i can only invite users.

The role atlassian-addons-project-access is available under browse projects.

Ariel Aguilar commented on 22 June 2021

Hi GHB,

The app user for Jira Cloud is created automatically. The app user is a proxy user for Exalate.

The username is Exalate and the email address is com.exalate.jiranode@connect.atlassian.com.

The proxy user on Jira Cloud should a member of the following user-groups:

atlassian-addons
atlassian-addons-admin
jira-core-users
jira-servicedesk-users
jira-software-users

Jira Cloud grants correct permissions to addons through the atlassian-addons-project-access role. If you want to ensure that the add-on has access to the project (where the issue is located) —add the group from the corresponding permission in the permission scheme.

This should help!

Kind regards,

Ariel

Answer by GHB on 06 July 2021

Hi Guys,

The role atlassian-addons-project-access is available on all project permissions in both Jira instances.

Can I verify that the proxy user is available?