Sidehistorik
Getting the Username
Kodeblok |
---|
<script type="text/javascript"> var user; AJS.$.ajax({ url: "/rest/gadget/1.0/currentUser", type: 'get', dataType: 'json', async: false, success: function(data) { user = data.username; } }); alert(user); </script> |
Getting all Groups (as objects):
Kodeblok |
---|
<script type="text/javascript"> var user; AJS.$.ajax({ url: "/rest/gadget/1.0/currentUser", type: 'get', dataType: 'json', async: false, success: function(data) { user = data.username; } }); var groups; AJS.$.ajax({ url: "/rest/api/2/user?username="+user+"&expand=groups", type: 'get', dataType: 'json', async: false, success: function(data) { groups = data.groups.items; } }); alert(groups); </script> |
Sample for hiding menu items
This sample hides the "Create Subtask" for a user or a user with a particular group membership.
...