Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Confluence CQL sample
- * Find all spaces (including archived ones) that are in Cloud category
- */
- const request = require('request')
- const options = {
- headers: { "Content-Type": "application/json" },
- auth: {
- user: process.env.USERNAME,
- password: process.env.PASSWORD
- }
- };
- function runCQL (confluenceURL, cql) {
- options.url = confluenceURL + '/rest/api/search?cql=' + cql
- request.get (options, function(err, res, body) {
- if (err) {
- console.log(err)
- } else {
- console.log(body)
- }
- })
- }
- const category = 'cloud'
- const cql = 'space.category="' + category + '" and type=space' + '&includeArchivedSpaces=true'
- runCQL(process.env.CONFLUENCE, cql)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement