How to set up custom field filtering in subscription API
I'm reading up on the subscription API and see that it is possible to filter events on custom fields. I seem to be missing part of the picture though, especially with regard to the job_status_changed event.
How can you automatically set up a custom field with a specific value for filtering on job level?
- I don't think it's possible to do this in the workflow definitions (for Classic Projects).
- Setting a default value for a custom field would also make no sense, because they would all be the same and useless for filtering.
- Setting it manually rather defeats the purpose and is not really error-proof.
- Using a macro + periodic job makes it time-based and therefore also not error-proof.
- Using a project_created event to trigger setting the custom field maybe? That would limit the number of events from 'every job status change' to 'every new project created', so significantly fewer, but it still doesn't feel like a clean solution.
Is there anyone with experience in this who can explain it to me?
Customer support service by UserEcho
Hi Thijs,
To make it clear - you'd like to have context-based custom field so you can use that for filtering whenever a new job_status_changed event is sent. Is that right?
Why do you think the last point on your list is flawed?
Best,
Bartosz
Hi Bartosz,
Based on this part from the documentation, I understand that filtering is recommended and that it's only possible to filter on specific custom fields (but no other fields, such as 'job type' etc.):
If that assumption is correct, and I can only filter using those custom fields, there should be an easy way to set those fields to a certain value. The last point on my list seems workable, but it still feels wasteful - it needs another subscription and probably a macro to set a custom field on job level in Classic Projects. Definitely doable, but it feels like a workaround rather than a proper solution. I was hoping someone had a better way to do this.