Skip to content

Problem with assigning issues to users #2021

Discussion options

You must be logged in to vote

Maybe try something like this?

issues = project.issues.list(state='opened')
for index, issue in enumerate(issues):
    issue = project.issues.get(issue.id)  # This may not be necessary but usually a good idea.
    if not issue.assignees:
      issue_assignees = get_group_members(stuff) //this is a custom function that I give it a group name, and it returns the IDs of the users in that group in a list e.g., [20, 40, 50, 21, 25]
    else:
        continue
    t = []
    for assignees in issue_assignees:
       t.append(assignees.id)
    issue.assignee_ids = t
    issue.save()
    issue = project.issues.get(issue.id)
    issue.pprint()

Replies: 4 comments 6 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
6 replies
@JohnVillalovos
Comment options

@MichaelSweikata
Comment options

@MichaelSweikata
Comment options

@nejch
Comment options

@MichaelSweikata
Comment options

Answer selected by JohnVillalovos
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
3 participants
Converted from issue

This discussion was converted from issue #2020 on May 16, 2022 16:48.