From b3d69a1bcb495f369b9d5264282a2f81caf48a15 Mon Sep 17 00:00:00 2001 From: Mathieu Cartaud Date: Thu, 18 Jun 2026 15:56:48 +0200 Subject: [PATCH] feat(observables): auto-populate AS number from Autonomous-System name When creating an Autonomous-System observable, automatically parse and set the `number` field if the name matches the pattern `AS` (e.g., typing "AS1234" fills in 1234 as the AS number). --- .../StixCyberObservableCreation.jsx | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/opencti-platform/opencti-front/src/private/components/observations/stix_cyber_observables/StixCyberObservableCreation.jsx b/opencti-platform/opencti-front/src/private/components/observations/stix_cyber_observables/StixCyberObservableCreation.jsx index 2f1699523e0f..034ff4f939a5 100644 --- a/opencti-platform/opencti-front/src/private/components/observations/stix_cyber_observables/StixCyberObservableCreation.jsx +++ b/opencti-platform/opencti-front/src/private/components/observations/stix_cyber_observables/StixCyberObservableCreation.jsx @@ -930,6 +930,29 @@ const StixCyberObservableCreation = ({ /> ); } + if ( + attribute.value === 'name' + && status.type === 'Autonomous-System' + ) { + const setDefaultAutonomousSystemId = (_, value) => { + const match = value.match(/^as(\d+)$/i); + if (match && !values.number) { + setFieldValue('number', parseInt(match[1], 10)); + } + }; + return ( + + ); + } return (