I’m currently working on a Jira Service Management app and looking to use the Confluence API to retrieve pages. However, I’ve encountered a challenge where the logs indicate that the pages
object is undefined . I’m seeking assistance in resolving this issue,btw its working when i try it using postman
this is my code :
resolver.define('getPages',async(req)=>{
try{
const res=await api.asApp().requestConfluence(
route`/wiki/api/v2/pages`,
{
headers:{
'Accept': 'application/json',
'X-ExperimentalApi':'opt-in'
},
})
const data=await res.json();
console.log(data)
console.log(`pages: ${data.results}`)
return data.results;
}
catch(err){
console.error('Error fetching articles:', error);
}
});
the manifest :
permissions: scopes: - read:servicedesk-request - read:page:confluence - read:confluence-space.summary - read:confluence-content.all - read:confluence-content.summary