
    V5h              
       j    d dl Z d dlmZmZmZ d dlmZmZmZ dde	deee	e	f      deee	ef      fdZ
y)	    N)OptionalDictAny)JIRA_URL	JIRA_USERJIRA_API_TOKEN	issue_keyjira_configreturnc                    | st        d       y|r|j                  dt              nt        }|r|j                  dt              nt        }|r|j                  dt              nt        }|st        d       y|j                  d      sd|z   }|j                  d	      }| d
|  }ddi}	 t        j                  |||f|d      }|j                          |j                         S # t        j                  j                  $ r}t        d|        Y d}~yd}~wt        j                  j                  $ r}t        d|        Y d}~yd}~ww xY w)a  Fetch issue details from Jira.

    Args:
        issue_key (str): The Jira issue key
        jira_config (Optional[Dict[str, str]]): Optional Jira configuration override

    Returns:
        Optional[Dict[str, Any]]: Issue details or None if fetch fails
    u   ❌ Issue key cannot be emptyNurlusertokenu   ❌ Jira URL cannot be empty)zhttp://https://r   /z/rest/api/3/issue/Acceptzapplication/json   )authheaderstimeoutu   ❌ Failed to fetch issue: u   ❌ Error decoding JSON: )printgetr   r   r   
startswithrstriprequestsraise_for_statusjson
exceptionsRequestExceptionJSONDecodeError)	r	   r
   jira_url	jira_user
jira_tokenr   r   responsees	            mD:\Onedrive\OneDrive - Evince Development Pvt. Ltd\automation\ui-based-testcase-generator\jira\jira_client.pyfetch_issuer'      s>    -. 4?{uh/HH6A	2yI=H.9nJ ,- 67( s#HJ(
4C+,G<<Z(	
 	!!#}}// +A3/0.. )!-.s$   *:C% %ED E5EE)N)r   typingr   r   r   config.settingsr   r   r   strr'        r&   <module>r-      sN     & & ? ?03 0Xd38n-E 0QYZ^_bdg_gZhQi 0r,   