Setting issue visibility from REST api

I'm using the python library to migrate our old custom butracking system into youtrack. So far everything has been working great as far as creating the 'migration' script, except for the following problem.

We want to make all of the imported issues only visible to the Developer group so we can later choose to turn on visibility for certain issues to everyone.  I can't seem to be able to figure out how to do this with the youtrack REST api.  I tried tweaking the createIssue function to include a 'permittedGroup=Developers' parameter as described at http://confluence.jetbrains.net/display/YTD4/Create+New+Issue, but I bad response from the server.

Anyone have advice on how to do this?  If the createIssue function doesn't work, is there a command I can issue to change the visibility?

Thanks,
  • Steve
7 comments
Comment actions Permalink
Hello, Steve!
In YouTrack you can't set any of your groups as visibility group. User can set group he belongs to or one of Assignee groups of project.
Please, check that your Developers group matches one of those conditions.
0
Comment actions Permalink
Hi Anna,
I'm not sure I understand your comments.  Maybe I was not clear with my initial question.  I've attached a screenshot of what I'm trying to adjust when I create a new issue with the REST api.
visibility.png


I just need an automatic way to set every issue in our project to not be visible to "All Users", but to some other group like "Developer".  Since we are creating a new youtrack project and populating it with issues in our old bugtrack system, I would like to be able to do this with the REST api.

If you did answer my question and I'm just being dense, I apologize.
Thanks,
  • Steve
0
Comment actions Permalink
Hello, Steve!
What was logged in user, when you made a screenshot ant what user do you use to run the script? Is it the same "root" user?
0
Comment actions Permalink
Hi Anna,
I made the screen shot with my logged in user account of "steve" which is in the admin group, but is not the "root" account.  The user for running the script is "yt_robot" which is an account I set up which also is also in the "admin" group.  The script that I've written so far works great for creating and deleting issues in youtrack from python; the only thing I haven't been able to get to work is automating of visibility for these issues.  This seems to be the last piece holding us up from switching over to using youtrack.

Thanks for your help and happy holidays.
  • Steve
0
Comment actions Permalink
Am I right, that "steve" user is in Developers group? And could you please provide a screenshot of your project's "Assignees" settings? You can find them in Admin -> Project -> Assignees
0
Comment actions Permalink
Hi Anna,
Yes 'steve' is in both the Admin and Developer groups. Here's a screenshot that you asked for.
Thanks,
  • Steve
assignees.png
0
Comment actions Permalink
Either you guys fixed this over the holidays or I was just plain doing something wrong, but things appear to be working now:)

For other people who are interested, I modified the python function for createIssue to just force the new issue to be visible only to the "Developer" group. Here's the tweaked function

def createIssue2(self, project, assignee, summary, description, priority=None, type=None, subsystem=None, state=None,
     affectsVersion=None,
     fixedVersion=None, fixedInBuild=None):
    params = {'project': project,
              'summary': summary,
              'description': description,
              'permittedGroup': 'Developer'} #<<== this is the addition
    if assignee is not None:
        params['assignee'] = assignee
    if priority is not None:
        params['priority'] = priority
    if type is not None:
        params['type'] = type
    if subsystem is not None:
        params['subsystem'] = subsystem
    if state is not None:
        params['state'] = state
    if affectsVersion is not None:
        params['affectsVersion'] = affectsVersion
    if fixedVersion is not None:
        params['fixVersion'] = fixedVersion
    if fixedInBuild is not None:
        params['fixedInBuild'] = fixedInBuild

    return self._reqXml('PUT', '/issue?' + urllib.urlencode(params), '')
prettyPrint();
0

Please sign in to leave a comment.