Expand my Community achievements bar.

SOLVED

Watch Record module when Planned Start and Completion Dates Change

Avatar

Level 10

Hi Fusion Community,

I'm attempting to create a Fusion scenario that has a Watch Record module with filter criteria monitoring when either the Planned Start Date OR Planned Completion Date of a task are changed.

I'm struggling to find a way to do this.  Any suggestions are welcome.
Thanks!
Nick

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Oh, in that case just use the watch events module.

View solution in original post

16 Replies

Avatar

Level 7

I've created custom formula fields that replicate the data for a few fields like these so that they will show up in the watch events.

 

Here's an example

Jason_JB_0-1688594466193.png

 

Avatar

Level 10

Thanks for the idea, Jason.  Are you able to elaborate?  How is that calculated field not just storing the most current Start Date value?  Wouldn't a comparison to the native Start Date field not be the same?  Also, how are you comparing them?

Avatar

Level 7

Yes, this gives the current value. The new/old values that come from the watch event will track current and old values.

Avatar

Level 10

If I'm understanding you correctly, this would mean that I would need to watch for any and all updates to tasks in my first Watch module, and then from there, compare new and old state values to further filter and refine, correct?

If that's accurate, the challenge with this is that I'm trying to limit how many times the initial module fires.  We have loads of updates happening to tasks every minute, so this thing would be constantly firing.  I was hoping to narrow the filter criteria down directly in the first Watch module so it only fires for specific instances (e.g. Planned Start Date or Planned Completion Date changes).

Avatar

Level 7

Yes, I agree with the challenge.

To address it in our environment, we have a scenario that monitors all tasks and determines if they need to trigger another scenario.  If they do need to trigger another scenario (b, c, d or e), then it updates corresponding custom fields correctly. The scenario that does the work then watches for changes on that field by the user in the first scenario.

 

This approach has been a huge help with performance and managing b/c we could let the assessment scenario process multiple things simultaneously and it runs much faster than those that actually do the work.

Avatar

Level 10

Interesting, Jason.  I don't know how many executions and operations your monitoring scenario produces on a daily, or even hourly basis, but I guess I can keep this in my back pocket as a potential option.  If planned out, I can see its benefit. I was hoping there was a more direct way.  Kind of surprised it's not easier to filter on new and old state within a watch event filter, as that would help reduce the load on Adobe's system.

Avatar

Level 10

WF Support had an interesting idea, but it might require me to learn a bit more along the way.  

 

"

No, you should still be able to accomplish this with one scenario, but it will require some finessing to get it right. I'll outline a few steps below on how to do this:

1. Set up a Custom Webhook module in the scenario (preferably a new scenario if possible). https://drop.workfront.com/KouEwPNO
* Make sure to copy down the address that the Webhook module gives you, it should be in this format: https://hook.app.workfrontfusion.com/
2. Create an Event Subscription for OR statement 1 (If the Planned Start Date or Planned Completion Date values on a task are modified (updated). As a note here, you cannot add in the month filtering within the Event Subscription, you'll need to add in that filtering later in the scenario.
* When setting up this Event Subscription, use the URL address that the Webhook module gave you in the "url" field: https://experienceleague.adobe.com/docs/workfront/using/adobe-workfront-api/event-subscriptions/even...
* When setting up the filters, use the following link as a guide for those filters: https://experienceleague.adobe.com/docs/workfront/using/adobe-workfront-api/event-subscriptions/even...
3. Create an Event Subscription for OR statement 2 (If the old state Status value is not equal to CPL (Complete) and the new state Status value is equal to CPL)
* When setting up this Event Subscription, use the URL address that the Webhook module gave you in the "url" field: https://experienceleague.adobe.com/docs/workfront/using/adobe-workfront-api/event-subscriptions/even...
* When setting up the filters, use the following link as a guide for those filters: https://experienceleague.adobe.com/docs/workfront/using/adobe-workfront-api/event-subscriptions/even...

 

My assumption is the Event Subscription they are talking about is accomplished via a Custom API Call module.  Not sure if you know?  If so, I'm assuming I would need to input some JSON text to the Body field to do my filtering there?  This is a bit over my head, so not sure if it makes sense to you or if you have any further direction?  

 

Screenshot 2023-07-06 at 5.39.33 PM.png

Avatar

Community Advisor

Yes, this is an option, but it is wildly more complicated, and my recommendation would be to use a calculated field with a watch events triggering off of that custom field, similar to my other comment. There are several negatives to doing what Workfront is recommending, and I have done this before, but in my case it was because I needed to watch different object types, so I couldn't do it off of a single watch events scenario. 

When they refer to "creating the subscription", what they're telling you to do is create the two Workfront webhooks manually, and point it to your custom Webhook module, see here about half way down, "Create event subscription API requests". Important note, you can't do that with the Workfront modules, you must use the true custom API call modules. 

Avatar

Community Advisor

The most straight forward way to do this would be to create a calculated field that is a concatenation of those two fields, and then just watch for this calculated field to change.

Otherwise, you would have to have two seperate scenarios, as webhooks in Workfront can't do OR statements.

Avatar

Level 10

Chris, I like this idea....wish calculated fields were available as a selection in the Watch Field event:

Screenshot 2023-07-06 at 4.40.01 PM.png

Avatar

Correct answer by
Community Advisor

Oh, in that case just use the watch events module.

Avatar

Level 10

Ahhh, yes, that's it!  Used the Changed filter in the Watch Events webhook.
Appreciate you entertaining this question.  Thanks.

Avatar

Level 10

One more Q, Chris - 
That new calculated field works properly, in that when I update either the Start, Completion, or Status (I added this in there) fields, this new field updates to reflect the change.

 

However, my Watch Event webhook isn't triggering when this calculated field changes.  Are you able to get this to work on your end?  Curious if my webhook is off, or if it doesn't recognize changes to calculated fields?

 

Webhook:

Screenshot 2023-07-07 at 11.46.46 AM.png

Avatar

Community Advisor

It should work. There are a couple of default fields that won't trigger a webhook and this is my standard workaround for that.

Avatar

Community Advisor

I just tested it and verified it works.

 

Is the Workfront account that's generating the webhook the same as the one that you're using to edit in Workfront?

Avatar

Level 10

Got'er working!
It may have been related to the "connection user updates excluded" setting.  I logged into Fusion as the sync user, not my personal user, and it still didn't work, so I recreated the webhook and it started working.  

Thanks again, Chris.