The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

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 Champions.
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 

DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events