Hi,
I have a question about Jira cloud: How can I insert a code snippet into a quoted text without having a Numbered List automatically included?
This was doable on Jira DC, but it's a bit of a pain to do in Jira cloud. Every time I try to add this, I get a Number List on the outside like:
It would be great to know how this can be resolved.
Cheers,
Ram
Hi @Ram Kumar Aravindakshan _Adaptavist_ welp, I could not replicate this at all. No numbered list showed up when I did the following:
Steps I tried:
Results:
I feel like this might be similar to Confluence, which doesn't allow nested macros? You can look at how Jira stores the data by using the rest api and looking for your field (ex: https://YOURSITE.atlassian.net/rest/api/3/issue/BUG-6)
This is an excerpt of what I found:
{
"type": "blockquote",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Here is some code I hope"
}
]
}
]
},
{
"type": "codeBlock",
"attrs": {
"language": "none"
},
"content": [
{
"type": "text",
"text": "This is some code\nAnd some other code"
}
]
},
An interesting experiment might be to try updating Description with Automation, and try using Wiki Markup?
The question would be could you do this with Automation:
{quote}
This is quoted text
{code:xml}
<test>
<another tag="attribute"/>
</test>
{code}
{quote}
And the answer is.... nope. I made an Automation Rule to try to put this into a Description, and got this:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Darryl Lee
Since you have the code snippet below the quote, do the following:-
1. Go into the quote, press enter once,
2. Go to the last line of the quote and click the delete button to bring the code snippet into the quote.
Cheers,
Ram
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Oh neat! It almost works! So yeah, the API is showing that it NESTED the codeBlock into an orderedList.
Now I wonder what this looks like in Automation...
HUH when I output {{issue.description}} to the audit log, I see:
{quote}Here is some code I hope # {code:none}This is some code And some other code{code} Nope{quote}
SOOOOO... yeah, I dunno. That looks very similar to what I tried to add via automation (without any spaces), except for the addition of the #.
Definitely a bug, I reckon.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For some reason, @Ram Kumar Aravindakshan _Adaptavist_, I cannot reproduce this (unless I format the snippet as a numbered list).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Wait! I just did another test. Once I added the numbered list format to the snippet, I could not turn it off.
However, I could copy the contents of the snippet; delete the snippet; create a new snippet block; and paste the copied text into it.
No more number outside the box.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The test doesn't seem to be complete.
Could you try to repeat that test, this time try to add the code snippet into a Quote, as shown in the image below:-
Thank you and Kind regards,
Ram
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks, @Ram Kumar Aravindakshan _Adaptavist_. Some how I was missing the "inside a quote" piece of this. I can reproduce now and I can find no workaround.
I think you discovered a bug 😱
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.