I am trying to retrieve custom properties that I set using AP.confluence.setContentProperty()
earlier. I am using AP.request()
to retrieve all the pages in my space and examine their properties (using expand=metadata.properties
), like this:
function getSpacePages (spaceKey) {
return new Promise((resolve, reject) => {
AP.request({
url: `/rest/api/space/${spaceKey}/content/page?expand=metadata.properties`,
success: (responseText) => {
let parsed = null;
try {
parsed = JSON.parse(responseText);
} catch (err) {
reject(err.message);
}
parsed.results ? resolve(parsed.results) : reject(parsed);
},
error: (xhr, statusText, errorThrown) => reject(statusText)
});
});
}
When I look at my results, I see the following:
You can see that my property (metadata.properties._expandable.validation
) is an empty string. However, when I look at the page properties for that same page using Confluence Property Tool add-on, I see my property as it should appear:
{
"key": "validation",
"value": {
"user": {
"fullName": "Zena Hirsch",
"id": "admin",
"key": "8a7f80835f03104d015f075b0c530048"
},
"date": "2017-10-20T11:27:20-04:00",
"validated": true
},
"version": {
"number": 7
}
}
Can anyone explain what I’m doing wrong? Thank you!