Expand Macro in JIRA description

Nico Mourad
Contributor
March 10, 2023

Hello, 
It seems that I can now use the expand macro in JIRA description (which is great). I would like to use this for automation scripts that I do and create several tickets. Nevertheless, I can't find a way to do it with the API.

I tried using the same macro as in Confluence : {expand}. 

If you have a tip on how to make it work that would be appreciated!

Thanks! 

 

1 answer

0 votes
Ivan Lima
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.
March 11, 2023

Hi, @Nico Mourad. Welcome to the Atlassian Community.

In Jira, you need to look at the Jira REST API documentation. You can also run a GET on your browser, which allows you to see the syntax to check the schema for that macro—assuming the ticket has a macro in the description or comment, for example. If you don't know that already, I'll leave a few links to help you explore that in more detail.

https://YOUR_SITE.atlassian.net/rest/api/3/issue/<ISSUE_KEY>

https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-comments/#api-rest-api-3-issue-issueidorkey-comment-post

You can also use the document viewer to test the UI representation of your content body.
https://developer.atlassian.com/cloud/jira/platform/apis/document/viewer/

(Untested) You could try something like in your REST API bodyData

{"version":1,"type":"doc","content":[{"type":"expand","attrs":{"title":"Please, click here to expand"},"content":[{"type":"paragraph","content":[{"type":"text","text":"Expand example"}]}]}]}

Cheers,
IL.

Nico Mourad
Contributor
March 13, 2023

Thanks for the answer, I already tried to get the issue to see what's stored on JIRA side, but nothing seems specific for that (it actually used the same syntax as lists), which makes me think JIRA stored additional metadata for this expand panel in order to render it. 

Like it's mentioned here : https://community.atlassian.com/t5/Jira-Software-questions/Macros-in-Jira-Automation/qaq-p/2079841 

Suggest an answer

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

Atlassian Community Events