Advertisement
Guest User

Untitled

a guest
Jul 19th, 2019
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. /**
  2. * Confluence CQL sample
  3. * Find all spaces (including archived ones) that are in Cloud category
  4. */
  5.  
  6. const request = require('request')
  7.  
  8. const options = {
  9. headers: { "Content-Type": "application/json" },
  10. auth: {
  11. user: process.env.USERNAME,
  12. password: process.env.PASSWORD
  13. }
  14. };
  15.  
  16. function runCQL (confluenceURL, cql) {
  17. options.url = confluenceURL + '/rest/api/search?cql=' + cql
  18. request.get (options, function(err, res, body) {
  19. if (err) {
  20. console.log(err)
  21. } else {
  22. console.log(body)
  23. }
  24. })
  25. }
  26.  
  27. const category = 'cloud'
  28. const cql = 'space.category="' + category + '" and type=space' + '&includeArchivedSpaces=true'
  29. runCQL(process.env.CONFLUENCE, cql)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement