Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

- Stop spamming the log with `\InvalidArgumentException` deprecation warnings from the notifier; throw `OCP\Notification\UnknownNotificationException` instead for unknown notifications.
- Fix `ValueError` from `vsprintf()` that broke notifications for non-English users.
- Migrate Jira Cloud search and notification calls to `/rest/api/3/search/jql`; the legacy `/rest/api/2/search` endpoint was removed by Atlassian (CHANGE-2046) and Cloud users were getting `410 Gone`. Self-hosted Jira (Server / Data Center) is unaffected and keeps the v2 endpoint (#122).

## 1.4.1 - 2025-11-10

Expand Down
14 changes: 11 additions & 3 deletions lib/Service/JiraAPIService.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,13 +169,17 @@ public function getNotifications(string $userId, ?string $since = null, ?int $li
}
}
} else {
// Jira cloud
// Jira cloud — /rest/api/2/search was removed (CHANGE-2046),
// must use the new /rest/api/3/search/jql endpoint which requires
// an explicit JQL and an explicit fields list.
$endPoint = 'rest/api/3/search/jql';
$params = ['jql' => 'assignee = currentUser()', 'fields' => '*all'];
$resources = $this->getJiraResources($userId);

foreach ($resources as $resource) {
$cloudId = $resource['id'];
$jiraUrl = $resource['url'];
$issuesResult = $this->networkService->oauthRequest($userId, 'ex/jira/' . $cloudId . '/' . $endPoint);
$issuesResult = $this->networkService->oauthRequest($userId, 'ex/jira/' . $cloudId . '/' . $endPoint, $params);
if (!isset($issuesResult['error']) && isset($issuesResult['issues'])) {
foreach ($issuesResult['issues'] as $k => $issue) {
$issuesResult['issues'][$k]['jiraUrl'] = $jiraUrl;
Expand Down Expand Up @@ -324,7 +328,11 @@ public function search(string $userId, string $query, int $offset = 0, int $limi
$myIssues[] = $issuesResult['issues'][$k];
}
} else {
// Jira cloud
// Jira cloud — /rest/api/2/search was removed (CHANGE-2046),
// must use the new /rest/api/3/search/jql endpoint which requires
// an explicit fields list.
$endPoint = 'rest/api/3/search/jql';
$params['fields'] = '*all';
$resources = $this->getJiraResources($userId);

foreach ($resources as $resource) {
Expand Down
3 changes: 2 additions & 1 deletion tests/unit/Service/JiraAPIServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ public function testSearch() {
$this->networkService->method('oauthRequest')->willReturnCallback(function (
string $userId, string $endPoint, array $params = [], string $method = 'GET',
) {
if (str_contains($endPoint, 'rest/api/2/search')) {
if (str_contains($endPoint, 'rest/api/3/search/jql')) {
$this->assertSame('*all', $params['fields'] ?? null);
return json_decode(file_get_contents('tests/data/search.json'), true);
}
return 'dummy';
Expand Down
Loading