My overarching task is to get all members of Jira _except those_ in a particular group, but I think I need some intermediary help before I can get there. I'm using jira-python, and I've gotten so far as to sort of get the group I need:
print jira.groups(query='jira-developers')
gives me
{u'header': u'Showing 1 of 1 matching groups', u'total': 1, u'groups': [{u'html': u'<b>jira-developers</b>', u'name': u'jira-developers'}]}
which was not the format I expected, but fine. I can't get the members of that group. The documentation seems to suggest that jira.group_members(group) should work, but I get the error that jira has no attribute group_members. Either the docs are lying or I'm an idiot, which are at least equally likely.
This works fine for me:
from jira.client import JIRA options = {'server': 'http://localhost:8080'} basic_auth = ('admin', 'password') jira = JIRA(options, basic_auth) users = jira.group_members('jira-developers') print users
N.B. You must be authenticated and have permission to run these queries.
If you're not the output of this script will give you a clue:
Your original quest to get all user which are not in a particular group will require some scripting.
I assume all your users are in the group 'jira-users'.
I'm still getting `AttributeError: 'JIRA' object has no attribute 'group_members'` from your code (obviously with my server, username and password substituted)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No, it's called something else. I created the script within sublime and I'm running it from there. Does that matter?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Wild guess: did you call your script "jira.py"?
If so, rename it to something else, delete the "jira.pyc" file, and try again.
Edit: scratch that, you would get another error.
Sorry, I don't know.
It could be a problem with your jira_python installation, but that's just a guess.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It shouldn't, but that's easy enough to try out by running the script from the commandline.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No help. Also tried typing in the same commands directly in the python prompt. Same error message: AttributeError: 'JIRA' object has no attribute 'group_members'
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have no clue.
Can you try installing Python and jira_python in a clean environment (VM or another PC) to see if that works?
If that works it proves your own installation has some problems.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I retried, installing jira-python from scratch in a virtualenv, and everything just works out of the box.
It looks like your problem is related to your environment, but I have no clue what it could be :(
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm not a regular user of jira-python, so I don't know. Have just installed and tested it for this problem.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It's already in a virtual environment. What was the command for getting group_members pre-6?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm not a regular user of jira-python, so I don't know. Have just installed and tested it for this problem.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.