diff --git a/client/src/app/pages/migration-waves/components/ticket-issue.tsx b/client/src/app/pages/migration-waves/components/ticket-issue.tsx index 6386c4ba48..a1004ffcb5 100644 --- a/client/src/app/pages/migration-waves/components/ticket-issue.tsx +++ b/client/src/app/pages/migration-waves/components/ticket-issue.tsx @@ -4,6 +4,7 @@ import { Text, TextVariants } from "@patternfly/react-core"; import { Ticket } from "@app/api/models"; import { useTranslation } from "react-i18next"; import ExternalLink from "@app/components/ExternalLink"; +import { useTrackerTypesByProjectId } from "@app/queries/trackers"; export interface ITicketIssueProps { ticket?: Ticket; @@ -11,16 +12,25 @@ export interface ITicketIssueProps { export const TicketIssue: React.FC = ({ ticket }) => { const { t } = useTranslation(); + const ticketIssue = useTicketIssue(ticket); return ( - <> - - {ticket?.link ? ( - {ticket?.link} - ) : ( - t("terms.unassigned") - )} - - + + {ticket?.link ? ( + {ticketIssue} + ) : ( + t("terms.unassigned") + )} + ); }; + +const useTicketIssue = (ticket?: Ticket) => { + const types = useTrackerTypesByProjectId( + ticket?.tracker?.name, + ticket?.parent + ); + const type = types.find((kind) => kind.id === ticket?.kind); + + return type ? type.name : ""; +};