I’m trying to automate changing labels for issues in a gitlab.com hosted repo.
For this I’ve written a python flask app to receive Issue and Note webhooks.
I’ve figured out that automatically generated notes (like ‘mentioned in merge request !MR-NUMBER’ or ’ marked this issue as a duplicate of #ISSUE-NUMBER’) doesn’t trigger a Note Hook. They also doesn’t show up as an event when querying the Events API.
However: Querying the Issue API shows these notes for an issue.
$ python3
Python 3.9.5 (default, May 4 2021, 03:36:27)
[Clang 12.0.0 (clang-1200.0.32.29)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import gitlab
>>> gl = gitlab.Gitlab(url='https://gitlab.com',private_token='XXXXXXXXXX')
>>> gl.projects.get(7898047).issues.get(17355).notes.list()[0].attributes["body"]
'mentioned in merge request !2827'
For the ‘mentioned in merge request’ note I “could” use the Merge Request Hook and parse the description value. But that reinvents the wheel.
Does anyone know how I can get/receive automatically generated notes events?
Am I missing something?
Thanks for taking the time to answer, it really helps!