diff --git a/src/people/widgetViews/PhasePlannerView.tsx b/src/people/widgetViews/PhasePlannerView.tsx index b4eefabb..fd59debb 100644 --- a/src/people/widgetViews/PhasePlannerView.tsx +++ b/src/people/widgetViews/PhasePlannerView.tsx @@ -76,11 +76,21 @@ const PhasePlannerView: React.FC = observer(() => { return; } - if (data.ticket_uuid && data.swwf_id) { - setSwwfLinks((prev: Record) => ({ - ...prev, - [data.ticket_uuid]: data.swwf_id - })); + if (data.action === 'swrun' && data.message && data.ticketDetails?.ticketUUID) { + try { + const stakworkId = data.message.replace( + 'https://jobs.stakwork.com/admin/projects/', + '' + ); + if (stakworkId) { + setSwwfLinks((prev: Record) => ({ + ...prev, + [data.ticketDetails.ticketUUID]: stakworkId + })); + } + } catch (error) { + console.error('Error processing Stakwork URL:', error); + } return; } diff --git a/src/store/interface.ts b/src/store/interface.ts index a260be2a..7a778f46 100644 --- a/src/store/interface.ts +++ b/src/store/interface.ts @@ -446,7 +446,7 @@ export interface TicketMessage { broadcastType: 'pool' | 'direct'; sourceSessionID: string; message: string; - action: 'process' | 'message' | 'run-link'; + action: 'process' | 'message' | 'run-link' | 'swrun'; ticketDetails: Ticket; }