How does Updating Issues with python Code work?
Im Using the Python Gitlab Library
https://python-gitlab.readthedocs.io/en/stable/gl_objects/issues.html
and the attributes i get from Gitlab Issues https://docs.gitlab.com/ee/api/issues.html
The Company im Working for, uses self managed Gitlab, were running on core version “13.2”.
We Automate much in the Issue section, like generated Issue when our internal support gets a request for a problem. To get some Statistics done we would like to automate the assignee stuff inside this section, but heres the Problem. we arent able to update issues with Python code.
first heres the Code.
def test():
closed_issues = pro_ject.issues.list(state='closed', assigne_username='none')
for issue in closed_issues:
issue.assignees = {
"avatar_url": "https://secure.gravatar.com/avatar/e5d35b4ff36f7c0e81c54ba92e009f27?s=80&d$
"state": "active",
"username": "my-username",
"id": 00,
"name": "my Name"}
issue.save()
print(issue) #Debug Purpose
After Python reaches the line “issue.save()” it crashes and giving us this little piece of error message:
Traceback (most recent call last):
File "__main__.py", line 21, in <module>
options.test()
File "/**/**/**/**/options.py", line 77, in test
issue.save()
File "/usr/local/lib/python3.7/dist-packages/gitlab/mixins.py", line 385, in save
server_data = self.manager.update(obj_id, updated_data, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/gitlab/exceptions.py", line 281, in wrapped_f
raise error(e.error_message, e.response_code, e.response_body) from e
gitlab.exceptions.GitlabUpdateError: 400: assignee_id, assignee_ids, confidential, created_at, description, discussion_locked, due_date, labels, add_labels, remove_labels, milestone_id, state_event, title are missing, at least one parameter must be provided
I tried to just assigne it with “assignee_iid=00” and “assignee_username=‘my-username’” but it wont work either. When i dont use the save() function, i see no errors in my output. and the issue seems like in the right format. Any explanation would help i guess.
Best Regards.