diff --git a/cli/phab-task.php b/cli/phab-task.php index 08e61ce..f62a64f 100755 --- a/cli/phab-task.php +++ b/cli/phab-task.php @@ -1,44 +1,49 @@ #!/usr/bin/php ClickUp bot # Copyright (C) 2023 Valerio Bozzolan, contributors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . /** * Receive Phabricator/Phorge Task info */ // autoload libraries require __DIR__ . '/../autoload.php'; $phab_task_id = $argv[1] ?? null; if( !$phab_task_id ) { echo "RTFM\n"; exit; } $phab_task_details = PhabricatorAPI::getTask( $phab_task_id ); echo print_r( $phab_task_details, JSON_PRETTY_PRINT ); echo "\n"; if( $phab_task_details ) { $phab_task_id = $phab_task_details['id']; $clickup_task = ClickUpPhabricatorCache::instance()->getClickupTaskFromPhabricatorTaskID( $phab_task_id ); print_r( $clickup_task ); echo "\n"; } + +ClickUpAPI::createOrUpdateFromPhabricatorTaskID( $phab_task_id, [ + // one year + 'max-clickup-age-seconds' => 31556952, +] );