I am creating remote link by this code or api , we can see that link created with help of postman api but when opening that jira issue in browser that is not coming:
def create_or_update_remote_link(issue_key, remote_link_url, remote_link_title):
# Create globalId using issue_key and encoded remote_link_title
global_id = f"{issue_key}:{remote_link_title}"
jira_base_url = os.getenv('JIRA_REMOTE_URL')
jira_icon = os.getenv('JIRA_URL_ICON')
url = f"{jira_base_url}/{issue_key}/remotelink"
# Prepare the request payload
payload = {
"application":{
"name": "Success Pilot"
},
"globalId": global_id,
"object": {
"icon": {
"title": "Success Pilot",
"url16x16": jira_icon
},
"url": remote_link_url,
"title": remote_link_title
}
}
try:
# Send the request to create or update the remote link
response = requests.post(url, headers=headers, auth=auth, data=json.dumps(payload), verify=True)
response.raise_for_status() # Raise an error for non-200 responses
# Parse and return the response
response_data = response.json()
return response_data.get("self")
except requests.RequestException as e:
error_logger.error(f"Error in making request to JIRA API Create or Update remote link: {e}")
return None