Expand my Community achievements bar.

Is it possible to reference/filter by project custom fields from a task-level API search request?

Avatar

Level 1

Since it doesn't seem to be possible to pull data directly from a report, I am trying to use the API to get all the tasks that fit certain conditions, and one of those conditions is that a custom field, called Date Booked, is not null. However, when I put "project:DE:Date Booked_Mod=notnull" into the URL, I get this error message:

{"error":{"message":"Invalid Parameter: Search Parameter value \"project:DE:Date Booked\"","title":null,"msgKey":"exception.attask","attributes":[""],"code":0}}

Is what I'm doing possible, and if so, what am I doing wrong? Either way, please let me know. 

 

Thank you. 

Topics

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

6 Replies

Avatar

Community Advisor

There isn't enough information here to do any kind of troubleshooting.

What is the API call you're trying to use? From your description, you're trying to pull tasks by filtering for a project field.

Why can't you pull the data from a standard report?

Avatar

Community Advisor

I think it might just be a syntax issue? Instead try 

&DE:project:YourFieldName_Mod=notnull

 

Avatar

Community Advisor

As Randy mentioned, you might get a bit further if you post the call. Are you getting the same/similar error message or has something else changed?

Avatar

Level 1

The URL looks like this, but I have deleted the API key for security reasons:

https://citlabels.my.workfront.com/attask/api/v16.0/task/search?apiKey=apiKey&method=GET&parentID_Mo...

 

I believe the problem is that project(DE:[any custom field]) cannot be reached from a task-level API call. That's what I'm trying to find out.

Avatar

Community Advisor

I was researching API in community the other day and realized this was never answered. So, just circling back on this one to confirm that the syntax for the project custom field was correct for me. The following would have worked.

&DE:project:your field name_Mod=notnull

 

If you went with a straight search on that one thing, my guess is it would work for you as well. https://citlabels.my.workfront.com/attask/api/v16.0/task/search?apiKey=apiKey&method=GET&DE:project:...

 

In other words, is it possible one of the other search strings is affecting your result? I did observe your other field name had slashes in the field name (booklet/label number). We have a policy of avoiding special characters in field names for exactly this reason (unpredictable results in an API call), so I'm not as familiar with that your options are here. The quickest fix would have been to rename your WF fields to remove all the slashes and then try and pass this call again.