code returns group names in the form [object,object], not the group name.


i am trying to get the names og the currently logged in users code returns the groups but in the form [object,object],, not the group name. how can i find the name of the group out of this object.I am using Jquery.



2 answers

1 accepted

Accepted Answer
0 votes


Thanks for all help and support. I caold finally complete my code and its working fine.

Thank You,


Try var myObject = AJS.$(objectToTransform). If this doesn't help you please show your source code and we will find a solution.

jQuery(document).ready(function() {

var abcd= [10];


var abcd=getGroups("asif_khan");
for (var i = 0; i < 3; i++) {
//var a= abcd[i]data.groups.items;

//varb= abcd.groups;


if(project_name == 'Customer ')

//window.alert('Message goes here');


function getGroups(user)
var groups;
url: "/rest/api/2/user?username="+user+"&expand=groups",
type: 'get',
dataType: 'json',
async: false,
success: function(data) {
groups = data.groups.items;
return groups;

This the the code iam using.

PLease make the required changes in the code if you can.That will be very helpfull.

I tried with the method you provided, but didnot work.Please try that method too if possible.

Thanks alot,


Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Sep 18, 2018 in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

27,605 views 2 7
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you