⚙ Operations Hub

ggiza
Participant

How to update deal owner when contact owner is updated via workflow?

SOLVE

Hello,

I created a deal-based workflow that triggers whenever the contact associated with it changed its owner.

For some reason, I can't copy the "contact owner" to the "deal owner" property.

I'm using a deal-based workflow is because I want to update the deals that aren't in the "closed" deal stage.

 

When I tried the contact-based workflow it updates all the deal owners associated with this contact regardless of what stage the deal is in.

Can anyone help guide me? Thank you!

2 Accepted solutions
karstenkoehler
Solution
Hall of Famer | Partner
Hall of Famer | Partner

How to update deal owner when contact owner is updated via workflow?

SOLVE

Hi @ggiza,

 

That's correct and expected behavior. Contact-based workflows will by default update all deals associated with the enrolled contact.

 

There is a new beta feature which lets you label deals with an association label. The label specifies the relationship between contact and deal. This then allows you in a contact-based workflows to choose the label of the deals to be updated. However, it's not possible yet to set a label that dynamically updates deal based on its Deal stage. This is simply not possible out of the box yet.*

 

I expect that sometime soon we'll be able to set association labels via workflow. This would then allow us to automatically apply an "open" label deals in a deal-based workflow. In turn, this label could then be referenced in a contact-based workflow, as explained above, updating all deals associated with the contact which have the "open" label.

 

Best regards!

 

* This can be solved with custom code action solution in HubSpot Operations Hub Professional. It would require some development and the Operations Hub Professional license.

Karsten Köhler
HubSpot Freelancer | RevOps & CRM Consultant | Community Hall of Famer

Beratungstermin mit Karsten vereinbaren

 

Did my post help answer your query? Help the community by marking it as a solution.

View solution in original post

nikodev
Solution
Top Contributor | Elite Partner
Top Contributor | Elite Partner

How to update deal owner when contact owner is updated via workflow?

SOLVE

Hi @ggiza

 

I can help to flesh out the coded action/API route a bit more.This solution would likely have to be implemented with the help of a developer. It's truly a magnicent tool, but I'm a bit biased. The general steps would include: 

1. Leave your enrollment triggers as is, so that each time the Contact owner changes, a Deal is enrolled.

2. Setup your coded action to return the dealstage and pipeline properties by default. These can then be accessed by using event.inputFields["propertyName"] within the coded action node. 

 

3. Use the Associations API read endpoint  to find all IDs of Contacts associated to the enrolled Deal. 

 

4. Map over those Contact IDs to make a request to the Contacts read endpoint, ensuring to include the dealstage and pipeline properties as parameters. https://developers.hubspot.com/docs/api/crm/contacts

Note - If there are instances where multiple Contacts are associated with a Deal, you may want to build some kind of logic that would help you identify the appropriate Contact. I'd be happy to expand on this if you'd like. 

5. Make a request once again to the Contacts API, this time to the update endpoint, using the value returned in 4 to overwrite the value of the hubspot_owner_id of the enrolled Deal. 

In the event you or someone else with a similar problem decided to go the coded action route, the above should be able to serve as a general guideline. 

A8 Labs

View solution in original post

6 Replies 6
nikodev
Solution
Top Contributor | Elite Partner
Top Contributor | Elite Partner

How to update deal owner when contact owner is updated via workflow?

SOLVE

Hi @ggiza

 

I can help to flesh out the coded action/API route a bit more.This solution would likely have to be implemented with the help of a developer. It's truly a magnicent tool, but I'm a bit biased. The general steps would include: 

1. Leave your enrollment triggers as is, so that each time the Contact owner changes, a Deal is enrolled.

2. Setup your coded action to return the dealstage and pipeline properties by default. These can then be accessed by using event.inputFields["propertyName"] within the coded action node. 

 

3. Use the Associations API read endpoint  to find all IDs of Contacts associated to the enrolled Deal. 

 

4. Map over those Contact IDs to make a request to the Contacts read endpoint, ensuring to include the dealstage and pipeline properties as parameters. https://developers.hubspot.com/docs/api/crm/contacts

Note - If there are instances where multiple Contacts are associated with a Deal, you may want to build some kind of logic that would help you identify the appropriate Contact. I'd be happy to expand on this if you'd like. 

5. Make a request once again to the Contacts API, this time to the update endpoint, using the value returned in 4 to overwrite the value of the hubspot_owner_id of the enrolled Deal. 

In the event you or someone else with a similar problem decided to go the coded action route, the above should be able to serve as a general guideline. 

A8 Labs

jhansen
Participant

How to update deal owner when contact owner is updated via workflow?

SOLVE

Here's a workaround that should do the trick, though I haven't tested it to be sure:

 

  • Create a second owner property on the deal side
  • Create your contact-based workflow but set it up to copy the contact owner to the new second owner field
  • Create a deal-based workflow that is triggered when the second owner is known. In an If/Then branch for deal open/closed, set the open side to copy the second owner to the deal owner then clear the second owner field. Set the closed side to simply clear the second owner.
  • NOTE: If you do not clear the second owner field, the new owner will have access to all closed deals for that contact

 

NHutchinson
Participant

How to update deal owner when contact owner is updated via workflow?

SOLVE

One consideration when copying to the 'second owner' field on the deal side. All associated deals will then send a notification to your assigned HubSpot users saying they have been assigned that deal (this is something which needs re-wording as purely setting someone in a 'HubSpot user property' prompts this notification). Even if you only want to set the contact owner on a subset of those deals. 

0 Upvotes
karstenkoehler
Solution
Hall of Famer | Partner
Hall of Famer | Partner

How to update deal owner when contact owner is updated via workflow?

SOLVE

Hi @ggiza,

 

That's correct and expected behavior. Contact-based workflows will by default update all deals associated with the enrolled contact.

 

There is a new beta feature which lets you label deals with an association label. The label specifies the relationship between contact and deal. This then allows you in a contact-based workflows to choose the label of the deals to be updated. However, it's not possible yet to set a label that dynamically updates deal based on its Deal stage. This is simply not possible out of the box yet.*

 

I expect that sometime soon we'll be able to set association labels via workflow. This would then allow us to automatically apply an "open" label deals in a deal-based workflow. In turn, this label could then be referenced in a contact-based workflow, as explained above, updating all deals associated with the contact which have the "open" label.

 

Best regards!

 

* This can be solved with custom code action solution in HubSpot Operations Hub Professional. It would require some development and the Operations Hub Professional license.

Karsten Köhler
HubSpot Freelancer | RevOps & CRM Consultant | Community Hall of Famer

Beratungstermin mit Karsten vereinbaren

 

Did my post help answer your query? Help the community by marking it as a solution.

ggiza
Participant

How to update deal owner when contact owner is updated via workflow?

SOLVE

Hey Karsten,

Thanks for the quick response here!

Other than the custom code action solution you suggested, is there a way for me to do that via API?
Like get all deals associated with this contact and only update those that are in the "open" deal stages?

Thank you!

karstenkoehler
Hall of Famer | Partner
Hall of Famer | Partner

How to update deal owner when contact owner is updated via workflow?

SOLVE

Hi @ggiza,

 

Yes, this can be achieved via the HubSpot CRM API: https://developers.hubspot.com/docs/api/crm/deals

 

Best regards!

Karsten Köhler
HubSpot Freelancer | RevOps & CRM Consultant | Community Hall of Famer

Beratungstermin mit Karsten vereinbaren

 

Did my post help answer your query? Help the community by marking it as a solution.

0 Upvotes