Custom Field into the Task Tick/Workbook Along with Created at date

Can Anyone Help to customize my server code for this feature ? I successfully added custom field into manifest but its now showing with task list.

I’m not a Phabricator dev, so this solution may be the incorrect, inefficient or just plain wrong, use this at your own risk, (maybe a dev can tell us if we are doing something horrendous,bad or just plain rude!)

To alter this you need to edit ManiphestTaskListView.php in phabricator/src/applications/maniphest/view

Where you want to put due date is where “Assigned:” is put

     if ($task->getOwnerPHID()) {
         $owner = $handles[$task->getOwnerPHID()];
         $item->addByline(pht('Assigned: %s', $owner->renderLink()));
       }

You can get to the tasks custom fields via the following

 $fields = PhabricatorCustomField::getObjectFields(
              $task,PhabricatorCustomField::ROLE_VIEW);

You could then pull out the field you want like this if you have to, (I suspect there is a better way of doing this…so you just ask for the specific field, but here we go for now…)

   if ($fields){
          $fields->readFieldsFromStorage($task);
          foreach ($fields->getFields() as $field){
          if ($field->getModernFieldKey()=='custom.mycustomfield'){
                 $item->addByline(pht('Due Date:%s', $field->getValueForStorage()));
                 $item->addByline(pht('Assigned: %s', $owner->renderLink()));
          }
   }

Remember you may have to format a date as the storage could well be the number of seconds since 1970, this is actually reasonably easy to do, but I’ll leave that for the reader.

I hope this helps

MyDeveloperDay