title: Get user's groups via Javascript in Atlasian Confluence
body: <p>Is it possible to get the groups the currently logged in user belongs to in Atlasian Confluence using Javasrcipt stored in the "Custom HTML"?</p>
  
  <p>I can get the currently logged in user as follows but cant find an example for getting the user's groups:</p>
  
  <pre><code>function getCurrentUserName(){
      var user;
      AJS.$.ajax({
          url: "/rest/gadget/1.0/currentUser",
          type: 'get',
          dataType: 'json',
          async: false,
          success: function(data) { user = data.username; }
      });
      return user;
  }
  </code></pre>