How to ensure code snippets are formatted when editing Jira description via an automation

Olie Ryan-George
Contributor
February 5, 2025

Hi everyone,

I'm adding some default descriptions to tickets via automations and am trying to get some text formatted as an inline code snippet.

I've tried to use this using the `` characters as specified in this document.

image.png

However, when the automation happens, the characters are just formatted as they are.

image.png

Does anyone have any idea how I do this?

 

2 answers

0 votes
Vishal Biyani
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 5, 2025

@Olie Ryan-George 

Try below and see which you like between noformat and code

 

{noformat} sudo npm install vsoagent-installer -g {noformat}

Example Text

{code:title=example.py|borderStyle=solid}

issue = jira.issue("TEST-123")

comments = issue.fields.comment.comments

for comment in comments:

    print(f"Author: {comment.author.displayName}, Comment: {comment.body}")

{code}

 

0 votes
Akash Singh
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 5, 2025

@Olie Ryan-George

The guide you referred to provides keyboard shortcuts for editing descriptions in Jira. To ensure your automation updates the description correctly, you can refer to this Markdown WikiRenderer guide for assistance:

https://jira.atlassian.com/secure/WikiRendererHelpAction.jspa?section=advanced.

For your specific use case, wrapping the shell command in {code:shell}<my code goes here>{code} should resolve the issue.

{code:shell}
python3 manage.py --do-something
{code}

 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events