Skip to content

Commit

Permalink
Add support for getting a custom fields for a given card
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenmaguire committed Mar 26, 2018
1 parent 984e43f commit 77a85b6
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 1 deletion.
6 changes: 6 additions & 0 deletions API-GUIDE.md
Expand Up @@ -608,6 +608,12 @@ $result = $client->addCardChecklist($cardId, $attributes);
$result = $client->deleteCardChecklist($cardId, $checklistId);
```

#### Get card custom field

```php
$result = $client->getCardCustomField($cardId, $customFieldId);
```

#### Update card custom field

```php
Expand Down
19 changes: 18 additions & 1 deletion CHANGELOG.md
@@ -1,7 +1,24 @@
#Changelog
# Changelog

All Notable changes to `trello-php` will be documented in this file

## 0.5.1 - 2018-03-26

### Added
- Added support for getting a custom fields for a given card

### Deprecated
- Nothing

### Fixed
- Nothing

### Removed
- Nothing

### Security
- Nothing

## 0.5.0 - 2018-03-23

### Added
Expand Down
1 change: 1 addition & 0 deletions src/Traits/ApiMethodsTrait.php
Expand Up @@ -140,6 +140,7 @@ trait ApiMethodsTrait
'addCardLabel' => ['post', 'cards/%s/labels'],
'updateCardLabel' => ['put', 'cards/%s/labels'],
'deleteCardLabel' => ['delete', 'cards/%s/labels/%s'],
'getCardCustomField' => ['get', 'cards/%s/customField/%s'],
'updateCardCustomField' => ['put', 'cards/%s/customField/%s'],
'getCardList' => ['get', 'cards/%s/list'],
'getCardListField' => ['get', 'cards/%s/list/%s'],
Expand Down
12 changes: 12 additions & 0 deletions tests/ApiTestTrait.php
Expand Up @@ -1319,6 +1319,18 @@ public function testDeleteCardChecklistCheckItem()
$this->assertExpectedEqualsResult($payload, $result);
}

public function testGetCardCustomField()
{
$cardId = $this->getTestString();
$customFieldId = $this->getTestString();
$payload = $this->getSuccessPayload();
$this->prepareFor("GET", sprintf("/cards/%s/customField/%s", $cardId, $customFieldId), "", $payload);

$result = $this->client->getCardCustomField($cardId, $customFieldId);

$this->assertExpectedEqualsResult($payload, $result);
}

public function testUpdateCardCustomField()
{
$cardId = $this->getTestString();
Expand Down

0 comments on commit 77a85b6

Please sign in to comment.