Events - How to Use
While Ceptah Bridge has a flexible mapping for almost every Jira field, sometimes, it may not be able to satisfy some very specific synchronisation requirements. In these cases, the product can be further customised by running pieces of VBA code at different stages of import or synchronisation.
In this tutorial, we will use VBA to synchronise time in days stored in a numeric custom field in Jira with Work in MS project.
The value of the Work field is expected to be in minutes, whereas the Jira field that we want to synchronise stores 8-hour working days. If we map the custom field directly to Work in the Custom Fields tab, we will not get the desired result. To import the days correctly to MS Project, we will put them into a custom numeric field first, and then transform that number into minutes and assign it to Work.
Map the custom field in Jira to a custom field in MS Project.

Open the Events tab, enable the 'Sync task: After updating' event and click Create.

This will create a VBA sub (event handler), which will be always executed for each task after the changes have been applied during synchronisation.

All events are described in detail in the User Guide.
Close the Project Settings.
To edit the event handler, click View > Macros in the MS Project Ribbon or press Alt-F11. Then select the VBA module for your project. Make sure that you do not confuse it with the Global template.

Modify the code of the sub as follows:
Sub OnSyncTaskAfterUpdate(Project As Project, Task As Task)
Task.Work = Task.Number1 * 8 * 60
End Sub

Go back to the Events tab and select the existing event handler for the 'Import task: After creating' event so that when we import tasks, they get the desired Work value. We will use the same event handler for both events.

Save the changes.
Now, when you import new or synchronise existing tasks, their Work will be set to the value from Jira converted to minutes.
You can find more examples of event handlers here.