Formatting code blocks using the Jira SM Cloud integration

Jorge Carpio December 28, 2022

I've connected Opsgenie with Jira (using the Jira Service Management Cloud integration) so certain alerts in Opsgenie are reflected as an issue in Jira.

I'm including YAML code blocks in the alert description using the text formatting notation specified here, so the issue description is something like: 

Some description of the alert here.

My code block:
{code:yaml}
metadata:
name: myname
key1: value1
data:
replicas: 1
somelist:
- item1
- item2
{code}

I expect the issue description to be something like:

Screenshot 2022-12-28 182618.png

The problem is the language is not being properly highlighted in Jira. Although it understands the code block as such, it doesn't seem to detect the configured language (YAML) and highlights it as Java code:

Screenshot 2022-12-28 182744.png

Is there any other way of formatting code blocks via API?

 

tl;dr: I'm trying to format a YAML code block using Jira's markup language, but the code block is being presented as Java code. I'm using the API interface, not the browser. What's the proper way to do it?

1 answer

1 vote
Shivam Naik
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 29, 2022

Hi @Jorge Carpio ,

This is a case I think would benefit from being looked at closer in a Support Ticket, but can you confirm what API endpoint you're using so that we can do some testing on our end between languages?

Thank you!

Shashi Matha June 19, 2023

@Shivam Naik - Did you resolve this issue?

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events