API search for updated in the last day | Community
Skip to main content
Level 4
February 1, 2023
Solved

API search for updated in the last day

  • February 1, 2023
  • 2 replies
  • 1676 views

Hello-

 

Can anyone tell me if it's possible to query the API for all tasks updated in the last hour?  My search will be a bit more specific, ie tasks within this portfolio and with projects with X attribute.  But basically I want to look tasks updated in NOW-60 or something like that. 

I am basically creating my own event notification by querying the system every 15 minutes or so and looking for changes.  The reason I don't think I can use the even subscription is because I am monitoring a custom field for changes.  Is that correct?  Can I use the even subscription somehow?    

Thanks, Mollie

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Doug_Den_Hoed_AtAppStore

 

Hi @molliesh,

 

Although I didn't see "h" (Hour; or Minute or Second for that matter) listed as being supported, from a quick test, running this snippet in my browser's Workfront tab's URL did appear to return only the Task that was updated within the past hour, so I invite you to try it, too:

 

https://yourdomain.my.workfront.com/attask/api/v15.0/task/search?lastUpdateDate=$$NOW-1h&lastUpdateDate_Mod=gt

 

That said, it doesn't appear to support decimals (e.g. $$NOW-0.25h), so "to the hour" might be the lowest level of granularity possible.

 

I look forward to hearing how you make out!

 

Regards,

Doug 

2 replies

Doug_Den_Hoed_AtAppStore
Community Advisor
Doug_Den_Hoed_AtAppStoreCommunity AdvisorAccepted solution
Community Advisor
February 1, 2023

 

Hi @molliesh,

 

Although I didn't see "h" (Hour; or Minute or Second for that matter) listed as being supported, from a quick test, running this snippet in my browser's Workfront tab's URL did appear to return only the Task that was updated within the past hour, so I invite you to try it, too:

 

https://yourdomain.my.workfront.com/attask/api/v15.0/task/search?lastUpdateDate=$$NOW-1h&lastUpdateDate_Mod=gt

 

That said, it doesn't appear to support decimals (e.g. $$NOW-0.25h), so "to the hour" might be the lowest level of granularity possible.

 

I look forward to hearing how you make out!

 

Regards,

Doug 

MollieShAuthor
Level 4
February 1, 2023

Awesome, that worked!  Much appreciated.  I think you may be correct about not being able to use minutes 

William
Community Advisor
Community Advisor
February 2, 2023

Doug's answer is great, so I'll speak to just the event subscription piece. 

You can create an event subscription for a value change on a custom field, but you have to make sure that tracking is enabled for that custom field in Setup > Interface > Update Feeds. Tracking is not available for calculated fields.

I'm sure you've seen this, but just in case here's a link to Event Subscription documentation:
https://experienceleague.adobe.com/docs/workfront/using/adobe-workfront-api/event-subscriptions/event-subs-api.html?lang=en

If you like my content, please take a moment to view and vote on my Idea Requests: https://tinyurl.com/4rbpr7hf