I’m trying to add videos to the ‘Actual Results’ section of a Jira issue so they’re playable right in the description. Right now, I can only get them to show up as clickable links. Here’s what I’ve tried:
def add_video_to_description(issue_key, section_name, video_urls):
# Get issue details
issue = jira.issue(issue_key)
current_description = issue.fields.description or ''
# Create video embed HTML
video_embeds = '\n'.join([f'<iframe src="{url}" width="560" height="315"></iframe>' for url in video_urls])
# Update description
if f'*{section_name}:*' in current_description:
new_description = current_description.replace(f'*{section_name}:*', f'*{section_name}:*\n{video_embeds}')
else:
new_description = f'{current_description}\n\n*{section_name}:*\n{video_embeds}'
# Save changes
issue.update(description=new_description)
But this doesn’t work. The videos aren’t playable in the Jira description. Any ideas on how to make this work?
hey there, i’ve dealt with this before. jira’s kinda picky about embeds. what worked for me was using the attachment macro. first upload ur vids as attachments, then in ur code use something like this in the description:
{attachment:filename.mp4}
it’ll show up as a playable video right in the description. hope that helps!
I’ve experienced similar issues with embedding videos into Jira descriptions. In my case, Jira security restrictions caused iframe embeds not to work, so I had to take a different approach. I uploaded the video content to an approved hosting service, for example Confluence or a supported cloud storage, and then attached the file to the Jira issue. After that, I updated the issue description using Jira’s attachment macro, which allowed the video to be played directly in the description. This method respects Jira’s security protocols while still offering an embedded video solution.
I’ve found that embedding videos directly in Jira descriptions can be tricky due to security restrictions. Instead, consider using Jira’s native attachment functionality. Upload your videos as attachments to the issue, then use the built-in attachment macro to display them in the description. This approach is more reliable and doesn’t require complex workarounds.
To implement this programmatically, you’d first need to upload the video file to the issue, then update the description to include the attachment macro. The macro syntax typically looks like:
!video.mp4|thumbnail!
This method ensures the videos are playable within Jira while maintaining security compliance. It’s a more straightforward solution that works consistently across different Jira configurations.