import React from "react"; import Link from "next/link"; import { observer } from "mobx-react-lite"; import { useFormContext, Controller } from "react-hook-form"; import { Plus } from "lucide-react"; // hooks import { useApplication, useEventTracker, useProject } from "hooks/store"; // components import { CustomSelect, Input } from "@plane/ui"; // helpers import { checkEmailValidity } from "helpers/string.helper"; // types import { IJiraImporterForm } from "@plane/types"; export const JiraGetImportDetail: React.FC = observer(() => { // store hooks const { commandPalette: commandPaletteStore } = useApplication(); const { setTrackElement } = useEventTracker(); const { workspaceProjectIds, getProjectById } = useProject(); // form info const { control, formState: { errors }, } = useFormContext(); return (

Jira Personal Access Token

Get to know your access token by navigating to{" "} Atlassian Settings

( )} /> {errors.metadata?.api_token &&

{errors.metadata.api_token.message}

}

Jira Project Key

If XXX-123 is your issue, then enter XXX

( )} /> {errors.metadata?.project_key && (

{errors.metadata.project_key.message}

)}

Jira Email Address

Enter the Email account that you use in Jira account

checkEmailValidity(value) || "Please enter a valid email address", }} render={({ field: { value, onChange, ref } }) => ( )} /> {errors.metadata?.email &&

{errors.metadata.email.message}

}

Jira Installation or Cloud Host Name

Enter your companies cloud host name

!/^https?:\/\//.test(value) || "Hostname should not begin with http:// or https://", }} render={({ field: { value, onChange, ref } }) => ( )} /> {errors.metadata?.cloud_hostname && (

{errors.metadata.cloud_hostname.message}

)}

Import to project

Select which project you want to import to.

( {value && value.trim() !== "" ? ( getProjectById(value)?.name ) : ( Select a project )} } optionsClassName="w-full" > {workspaceProjectIds && workspaceProjectIds.length > 0 ? ( workspaceProjectIds.map((projectId) => { const projectDetails = getProjectById(projectId); if (!projectDetails) return; return ( {projectDetails.name} ); }) ) : (

You don{"'"}t have any project. Please create a project first.

)}
)} />
); });