tasks.api.scrum.epic.update
Обновить эпик в Скраме
Описание
Метод обновляет эпик в Скраме.
Параметры
id
integer
обязательный
Идентификатор эпика.
Получить идентификаторы эпиков можно методом tasks.api.scrum.epic.list
fields
array
обязательный
Значения полей (подробное описание приведено ниже) для добавления нового эпика в виде структуры:
fields: {
name: 'значение',
groupId: 'значение',
description: 'значение',
color: 'значение',
files: [
'файл1',
'файл2',
...
]
}Параметр fields
name
string
обязательный
Название эпика
description
string
необязательный
Описание эпика
groupId
integer
обязательный
Идентификатор группы (скрама), к которой относится эпик
color
string
необязательный
Цвет эпика
files
array
необязательный
Массив файлов, привязанных к эпику.
В files можно передать массив значений с идентификаторами файлов, указав префикс n для каждого идентификатора.
Внимание
Если передать пустой массив — файлы удалятся
Примеры запроса
curl -X POST \
-H "Content-Type: application/json" \
-d '{
"fields": {
"id": 1,
"fields": {
"name": "Updated epic name",
"description": "Updated description text",
"color": "#bbecf1",
"files": ["n429", "n243"]
}
},
}' \
https://your-domain.bitrix24.com/rest/_USER_ID_/_CODE_/tasks.api.scrum.epic.update
curl -X POST \
-H "Content-Type: application/json" \
-d '{
"fields": {
"id": 1,
"fields": {
"name": "Updated epic name",
"description": "Updated description text",
"color": "#bbecf1",
"files": ["n429", "n243"]
}
},
auth=YOUR_ACCESS_TOKEN
}' \
https://your-domain.bitrix24.com/rest/tasks.api.scrum.epic.update
// This snippet is an ES module: top-level await requires type="module" or a bundler.
// $b24 is an already-initialized SDK instance (see the SDK "Get started" guide).
import { Text } from '@bitrix24/b24jssdk'
import type { B24Frame } from '@bitrix24/b24jssdk'
declare const $b24: B24Frame
// Shape of the payload returned in result (match the "response handling" section of the page)
type EpicUpdateResult = {
id: number
groupId: number
name: string
description: string
createdBy: number
modifiedBy: number
color: string
}
try {
const response = await $b24.actions.v2.call.make<EpicUpdateResult>({
method: 'tasks.api.scrum.epic.update',
params: {
id: 1,
fields: {
name: 'Updated epic name',
description: 'Updated description text',
color: '#bbecf1',
files: ['n429', 'n243'],
},
},
requestId: Text.getUuidRfc4122()
})
// The payload is available only on a successful response
if (!response.isSuccess) {
console.error(response.getErrorMessages().join('; '))
} else {
const result = response.getData()!.result
console.info('Updated epic:', result.id, result.name, result.color)
}
} catch (error) {
// Thrown on transport or SDK failures (AjaxError, SdkError, etc.)
console.error(error)
}
<!-- Load the SDK (UMD build); it is exposed as the global B24Js -->
<script src="https://unpkg.com/@bitrix24/b24jssdk@1/dist/umd/index.min.js"></script>
<script>
async function updateEpic() {
try {
// Initialize the SDK inside a Bitrix24 frame
const $b24 = await B24Js.initializeB24Frame()
const response = await $b24.actions.v2.call.make({
method: 'tasks.api.scrum.epic.update',
params: {
id: 1,
fields: {
name: 'Updated epic name',
description: 'Updated description text',
color: '#bbecf1',
files: ['n429', 'n243'],
},
},
requestId: B24Js.Text.getUuidRfc4122()
})
// The payload is available only on a successful response
if (!response.isSuccess) {
console.error(response.getErrorMessages().join('; '))
return
}
const result = response.getData().result
console.info('Updated epic:', result.id, result.name, result.color)
} catch (error) {
// Thrown on transport or SDK failures (AjaxError, SdkError, etc.)
console.error(error)
}
}
document.addEventListener('DOMContentLoaded', updateEpic)
</script>
from b24pysdk.errors import BitrixAPIError, BitrixSDKException
try:
bitrix_response = client.tasks.api.scrum.epic.update(
bitrix_id=1,
fields={
"name": "Updated epic name",
"description": "Updated description text",
"color": "#bbecf1",
"files": [
"n429",
"n243",
],
},
).response
result = bitrix_response.result
print(result)
except BitrixAPIError as error:
print(
"Ошибка Bitrix API",
f"error: {error.error}",
f"error_description: {error.error_description}",
sep="\n",
)
except BitrixSDKException as error:
print(f"Ошибка Bitrix SDK: {error.message}")
except Exception as error:
print(f"Непредвиденная ошибка: {error}")
try {
$epicId = 1;
$name = 'Updated epic name';
$description = 'Updated description text';
$color = '#bbecf1';
$files = ['n429', 'n243'];
$response = $b24Service
->core
->call(
'tasks.api.scrum.epic.update',
[
'id' => $epicId,
'fields' => [
'name' => $name,
'description' => $description,
'color' => $color,
'files' => $files
]
]
);
$result = $response
->getResponseData()
->getResult();
echo 'Success: ' . print_r($result, true);
} catch (Throwable $e) {
error_log($e->getMessage());
echo 'Error updating epic: ' . $e->getMessage();
}
const epicId = 1;
const name = 'Updated epic name';
const description = 'Updated description text';
const color = '#bbecf1';
const files = ['n429', 'n243'];
BX24.callMethod(
'tasks.api.scrum.epic.update',
{
id: epicId,
fields:{
name: name,
description: description,
color: color,
files: files
}
},
function(res)
{
console.log(res);
}
);
require_once('crest.php'); // подключение CRest PHP SDK
$epicId = 1;
$name = 'Updated epic name';
$description = 'Updated description text';
$color = '#bbecf1';
$files = ['n429', 'n243'];
// выполнение запроса к REST API
$result = CRest::call(
'tasks.api.scrum.epic.update',
[
'id' => $epicId,
'fields' => [
'name' => $name,
'description' => $description,
'color' => $color,
'files' => $files
]
]
);
// Обработка ответа от Битрикс24
if ($result['error']) {
echo 'Error: '.$result['error_description'];
}
else {
print_r($result['result']);
}
Ответ
{
"id": 1,
"groupId": 143,
"name": "Updated epic name",
"description": "Updated description text",
"createdBy": 1,
"modifiedBy": 1,
"color": "#bbecf1"
}
Возвращаемые данные
id
integer
Идентификатор эпика
groupId
integer
Идентификатор группы (скрама), к которой привязан эпик
name
string
Название эпика
description
string
Описание эпика
createdBy
integer
Идентификатор пользователя, создавшего эпик
modifiedBy
integer
Идентификатор пользователя, который последним изменял эпик
color
string
Цвет эпика
Обработка ошибок
HTTP-статус: 400
{
"error": 0,
"error_description": "Epic not updated"
}
| Код | Описание | Значение |
|---|---|---|
0 |
Access denied | Нет доступа для просмотра данных эпика |
0 |
Epic not found | Такого эпика не существует |
0 |
Epic not updated | Не удалось обновить эпик |
0 |
createdBy user not found | Пользователь в поле «создатель» не найден |
0 |
modifiedBy user not found | Пользователь в поле «последний изменивший» не найден |
100 |
Could not find value for parameter {id} | Неверно указано имя параметра или не задан параметр |
100 |
Invalid value {stringValue} to match with parameter {id}. Should be value of type int. | Неверный тип параметра |

