<p><ac:structured-macro ac:name="jira" ac:schema-version="1" ac:macro-id="1393fd5d-3e32-4792-a5ec-49c6f573ffea"><ac:parameter ac:name="server">Atlassian JIRA</ac:parameter><ac:parameter ac:name="columns">key,summary,type,created,updated,due,assignee,reporter,priority,status,resolution</ac:parameter><ac:parameter ac:name="maximumIssues">10</ac:parameter><ac:parameter ac:name="jqlQuery">project = 13310 AND fixVersion = 50817 ORDER BY priority DESC, key ASC </ac:parameter><ac:parameter ac:name="serverId">144880e9-a353-312f-9412-ed028e8166fa</ac:parameter></ac:structured-macro></p><p>asdf</p><ac:structured-macro ac:name="code" ac:schema-version="1" ac:macro-id="ef63a699-3ddf-4bb9-95d8-6ad31e58bcd8"><ac:parameter ac:name="language">cpp</ac:parameter><ac:plain-text-body><![CDATA[sdfg
int lalka;]]></ac:plain-text-body></ac:structured-macro><p> </p>
"url": "/macro-page?pageId={page.id}&pageVersion={page.version}¯oId={macro.id}",
AP.require("request", function(request) {
request({
url: "/rest/api/content/" + "{{pageId}}"
+ "/history/" + "{{pageVersion}}"
+ "/macro/id/" + "{{macroId}}",
success: function(response){
console.log(JSON.parse(response).body); // empty '<p><p>' body
}
})
});
confluence.getMacroBody(function(body) {
console.log(body); //body with macro
}
{"name":"my-macro","body":"<p></p>","_links":{"base":"http://my-PC:1990/confluence","context":"/confluence"}}
{"name":"my-macro","body":"<p></p><p>asdf</p>","_links":{"base":"http://my-PC:1990/confluence","context":"/confluence"}}
--
You received this message because you are subscribed to the Google Groups "Atlassian Connect Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to atlassian-connec...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Here's another thought: there's a leading "<p>". Can you try getting rid of this prefix?
In your example, its not clear where you are getting the pageId, pageVersion and macroId, can you show us that by attaching the entire file to this thread please.
app.get('/macro-page', addon.authenticate(), function(req, res) { var column = req.param('column'); var pageId = req.param('pageId'); var pageVersion = req.param('pageVersion'); var macroId = req.param('macroId');
res.render('macro/macro-view', {
pageId: pageId, pageVersion: pageVersion, macroId: macroId }); });A few things to note about the macro Id's. If you are specifying one (like you are in the example) and you are adding to a page that already contains that macro Id, then one of the id's will be regenerated (to make sure its unique). Is the page you are working with empty apart from the storage format you are creating? Unless you can be pretty sure no one else is going to use the macro id, you are better off not specifying it when creating the page content.
<ac:structured-macro ac:macro-id="e1f14bb3-385f-48cf-ab2e-ad9ab9c0b2e6" ac:name="table-filter" ac:schema-version="1"><ac:rich-text-body>
<p><ac:structured-macro ac:macro-id="75754a40-e72f-45dd-8b45-720c1c7dcb3d" ac:name="jira" ac:schema-version="1"><ac:parameter ac:name="server">Atlassian JIRA</ac:parameter><ac:parameter ac:name="columns">key,summary,type,created,updated,due,assignee,reporter,priority,status,resolution</ac:parameter><ac:parameter ac:name="maximumIssues">20</ac:parameter><ac:parameter ac:name="jqlQuery">project = 13310 AND fixVersion = 50817 ORDER BY priority DESC, key ASC </ac:parameter><ac:parameter ac:name="serverId">144880e9-a353-312f-9412-ed028e8166fa</ac:parameter></ac:structured-macro></p></ac:rich-text-body></ac:structured-macro>
The configuration for the macro you are setting the body for (my-macro) must have a body type set, can you please also attach the definition of this macro from your addon descriptor?
"bodyType": "RICH-TEXT"
ATLAS Version: 5.0.13ATLAS Home: d:\work\programms\atlassian-plugin-sdkATLAS Scripts: d:\work\programms\atlassian-plugin-sdk\binATLAS Maven Home: d:\work\programms\atlassian-plugin-sdk\apache-maven-3.2.1--------Executing: "d:\work\programms\atlassian-plugin-sdk\apache-maven-3.2.1\bin\mvn.bat" --version -gs d:\work\programms\atlassian-plugin-sdk\apache-maven-3.2.1/conf/settings.xmlJava HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256M; support was removed in 8.0Apache Maven 3.2.1 (ea8b2b07643dbb1b84b6d16e1f08391b666bc1e9; 2014-02-14T20:37:52+03:00)Maven home: d:\work\programms\atlassian-plugin-sdk\apache-maven-3.2.1\bin\..Java version: 1.8.0_51, vendor: Oracle CorporationJava home: c:\Program Files\Java\jdk1.8.0_51\jreDefault locale: ru_RU, platform encoding: Cp1251OS name: "windows 7", version: "6.1", arch: "amd64", family: "dos"
atlas-run-standalone --product confluence --version 5.9.1-OD-61-011 --bundled-plugins com.atlassian.bundles:json-schema-validator-atlassian-bundle:1.0.4,com.atlassian.webhooks:atlassian-webhooks-plugin:1.0.6,com.atlassian.jwt:jwt-plugin:1.2.2,com.atlassian.upm:atlassian-universal-plugin-manager-plugin:2.19.0.6-D20150709T232251,com.atlassian.plugins:atlassian-connect-plugin:1.1.38 --jvmargs -Datlassian.upm.on.demand=true