1

I am trying to retrieve objects from the AtTask API, but only some of them are being retrieved. The seven objects I need are as follows (with each result on the right; if "ok", they are giving results correctly):

  • projectName - ok
  • ID - ok
  • refreshDate - blank
  • referenceNumber - all return 0
  • actualCompletionDate - all return 1/1/0001 12:00:00 am
  • portfolioID - blank
  • status - ok

My code:

JToken projects = client.Search(ObjCode.PROJECT, new { groupID = userGroupID, __LIMIT = 2000 });
foreach (var j in projects["data"].Children())
{
    Console.WriteLine("Project Name: {0}", j.Value<string>("name"));
    Console.WriteLine("ID: {0}", j.Value<string>("ID"));
    Console.WriteLine("Refresh date: {0}", j.Value<string>("refreshDate"));
    Console.WriteLine("Reference number: {0}", j.Value<int>("referenceNumber"));
    Console.WriteLine("Actual completion date: {0}", j.Value<DateTime>("actualCompletionDate"));
    Console.WriteLine("Portfolio ID: {0}", j.Value<string>("portfolioID"));
    Console.WriteLine("Status: {0}", j.Value<string>("status"));
}

Each API key and field type are named according to https://developers.workfront.com/api-docs/api-explorer/.

Why aren't refreshDate, referenceNumber, actualCompletionDate, and portfolioID returning correct values, while the other three are?

  • Are you sure they are not returning correct values? What should the values be? – austin wernli Aug 04 '15 at 15:18
  • For one, most of the projects I'm retrieving data for have already been completed. With that in mind, you would think actualCompletionDate would be something other than 1/1/0001... Moreover, my company has been using all of these objects from AtTask before now, but they were retrieved a different way. I am now writing this program to replace what they were doing previously. – Cerium Plexus Aug 04 '15 at 15:45

1 Answers1

1

you need to specify fields in your search otherwise it will not pull all but the default information.

so this should work

JToken projects = client.Search(ObjCode.PROJECT, new { groupID = userGroupID, __LIMIT = 2000 , fields = "name,ID,refreshDate,referenceNumber,actualCompletionDate,portfolioID,status"});
michael johnson
  • 757
  • 1
  • 4
  • 10