tasks.api.scrum.task.get
Получить поля задачи Скрама по id
Описание
Метод получает значения полей задачи Скрама по её идентификатору id.
Параметры
id
integer
обязательный
Идентификатор задачи
Примеры запроса
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"id":1}' \
https://**put_your_bitrix24_address**/rest/**put_your_user_id_here**/**put_your_webhook_here**/tasks.api.scrum.task.get
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"id":1,"auth":"**put_access_token_here**"}' \
https://**put_your_bitrix24_address**/rest/tasks.api.scrum.task.get
// 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 ScrumTaskResult = {
entityId: number
storyPoints: string
epicId: number
sort: number
createdBy: number
modifiedBy: number
}
try {
const response = await $b24.actions.v2.call.make<ScrumTaskResult>({
method: 'tasks.api.scrum.task.get',
params: {
id: 1,
},
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(result.entityId, result.storyPoints, result.epicId)
}
} 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 getScrumTask() {
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.task.get',
params: {
id: 1,
},
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(result.entityId, result.storyPoints, result.epicId)
} catch (error) {
// Thrown on transport or SDK failures (AjaxError, SdkError, etc.)
console.error(error)
}
}
document.addEventListener('DOMContentLoaded', getScrumTask)
</script>
from b24pysdk.errors import BitrixAPIError, BitrixSDKException
try:
bitrix_response = client.tasks.api.scrum.task.get(
bitrix_id=1,
).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 {
$response = $b24Service
->core
->call(
'tasks.api.scrum.task.get',
[
'id' => 1
]
);
$result = $response
->getResponseData()
->getResult();
if ($result->error()) {
error_log($result->error());
echo 'Error: ' . $result->error();
} else {
echo 'Success: ' . print_r($result->data(), true);
}
} catch (Throwable $e) {
error_log($e->getMessage());
echo 'Error getting scrum task: ' . $e->getMessage();
}
BX24.callMethod(
'tasks.api.scrum.task.get',
{
id: 1
},
function(result)
{
if (result.error())
console.error(result.error());
else
console.dir(result.data());
}
);
require_once('crest.php');
$result = CRest::call(
'tasks.api.scrum.task.get',
[
'id' => 1
]
);
echo '<PRE>';
print_r($result);
echo '</PRE>';
// client и ctx уже созданы — см. раздел «SDK для Go»
res, err := client.Core().Call(ctx, "tasks.api.scrum.task.get", b24.Params{
"id": 1,
}, b24.WithIdempotent())
if err != nil {
return fmt.Errorf("tasks.api.scrum.task.get: %w", err)
}
var item struct {
EntityID b24.ID `json:"entityId"`
StoryPoints string `json:"storyPoints"`
EpicID b24.ID `json:"epicId"`
Sort int `json:"sort"`
CreatedBy int `json:"createdBy"`
ModifiedBy int `json:"modifiedBy"`
}
if err := json.Unmarshal(res.Result, &item); err != nil {
return fmt.Errorf("разбор ответа: %w", err)
}
fmt.Println(item.EntityID, item.StoryPoints)
Ответ
HTTP-статус: 200
{
"result": {
"entityId": 2,
"storyPoints": "2",
"epicId": 4,
"sort": 1,
"createdBy": 1,
"modifiedBy": 1
},
"time": {
"start": 1721402687.900315,
"finish": 1721402694.313811,
"duration": 6.413496017456055,
"processing": 6.387248992919922,
"date_start": "2024-07-19T15:24:47+00:00",
"date_finish": "2024-07-19T15:24:54+00:00",
"operating": 6.387217998504639
}
}
Возвращаемые данные
result
object
Объект с данными задачи
entityId
integer
Идентификатор бэклога или спринта
storyPoints
string
Количество стори поинтов.
Тип данных — строка, так как стори поинтом необязательно будет число
epicId
integer
Идентификатор эпика
sort
integer
Сортировка
createdBy
integer
Идентификатор пользователя, создавшего задачу
modifiedBy
integer
Идентификатор пользователя, который последним изменял задачу
time
array
Информация о времени выполнения запроса
Обработка ошибок
HTTP-статус: 200
{
"error": 0,
"error_description": "Task not found"
}
| Код | Описание | Значение |
|---|---|---|
0 |
Task 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. | Неверный тип параметра |

