Expand my Community achievements bar.

Come join us for our Coffee Break this WEDNESDAY on top takeaways from Adobe Summit!
SOLVED

API search for updated in the last day

Avatar

Level 6

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

1 Accepted Solution

Avatar

Correct answer by
Level 10

 

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 

 

TIP: if this solved your problem, I invite you to consider marking it as a Correct Answer to help others who might also find it of use

View solution in original post

6 Replies

Avatar

Correct answer by
Level 10

 

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 

 

TIP: if this solved your problem, I invite you to consider marking it as a Correct Answer to help others who might also find it of use

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

Hi,

 

using a capital M like

task/search?lastUpdateDate=$$NOW-1M&lastUpdateDate_Mod=gt&fields=lastUpdateDate

lets the whole thing break down to minutes.

 

Regards

Lars

Avatar

Level 6

Just wanted to say thank you for this post from 6 months ago. Really helped me figure out the same problem today in record time!! All hail Doug!! 

Avatar

Level 10

 

Thanks @MollieSh -- I'm glad it helped!

 

Also, as I looked this one up again to refresh my memory on what problem it solved, I noticed (and Liked) the follow up from @lgaertner who figured out that "M" is the magic character to use in order to check for updates within the last certain number of minutes, vs the "h" hours I'd mentioned -- thanks Lars!

 

Regards,

Doug

Avatar

Community Advisor

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/even...

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