Hi @ataf,
Going forward, you could set up two workflows to log the information you’re interested in.
In a deal-based workflow, enroll deals when the contact property Associated deals is known. If this number is equal to 1, then set your custom deal property Transaction type to “First”. If this number is greater than one, then set your custom property Transaction type to "Repeat.
In a contact-based workflow, enroll contacts when the the contact property Associated deals is equal to 1. If the deal property Pipeline is [pipeline 1], then set your custom contact property Pipeline of first transaction to [pipeline 1]. If the deal property Pipeline is [pipeline 2], then set your custom contact property Pipeline of first transaction to [pipeline 2].
For all existing deals, I can’t think of any way to backfill the information. HubSpot workflows currently don’t allow for comparing two objects, so you wouldn’t be able tell the first transactions apart from the repeat transactions, unfortunately. For existing deals, Excel is probably going to be your best friend: export existing deals, manually going through them to assign first and repeat, re-import.
After import, you could run a contact-based workflow, enrolling all contacts with deal property Transaction type known. If deal property Transaction type is “First” and Pipeline is [pipeline 1], set contact property Pipeline of first transaction to [pipeline 1]. If deal property Transaction type is “First” and Pipeline is [pipeline 2], set contact property Pipeline of first transaction to [pipeline 2]. (This workflow would actually do the job of the contact-based workflow from my second paragraph as well.)
I haven’t tested any of the above, so make sure to test it on a few records before unleashing it onto your whole database.
Hope this helps!