"use client"; import React from "react"; import { observer } from "mobx-react"; import Link from "next/link"; import { useFormContext, Controller } from "react-hook-form"; import { Plus } from "lucide-react"; import { IJiraImporterForm } from "@plane/types"; // hooks // components import { CustomSelect, Input } from "@plane/ui"; // helpers import { checkEmailValidity } from "@/helpers/string.helper"; import { useCommandPalette, useEventTracker, useProject } from "@/hooks/store"; // types export const JiraGetImportDetail: React.FC = observer(() => { // store hooks const { toggleCreateProjectModal } = useCommandPalette(); 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.

)}
)} />
); });