Thursday, October 13, 2022

How to use `not` condition in the gitlab api issue query

From Gitlab issues api documentation, not is of type Hash. It's a special type documented here

For example to exclude the labels Category:DAST and devops::secure, and to exclude the milestone 13.11, you would use the following parameters:

not[labels]=Category:DAST,devops::secure
not[milestone]=13.11

api example: https://gitlab.com/api/v4/issues?scope=all&state=opened&assignee_username=derekferguson&not[labels]=Category:DAST,devops::secure&not[milestone]=13.11

Using gitlab python module, you would need to pass some extra parameters by adding more keyword arguments:

import gitlab

gl = gitlab.Gitlab('https://gitlab.com')

extra_params = {
    'not[labels]': "Category:DAST,devops::secure",
    "not[milestone]": "13.11"
}
issues = gl.issues.list(all=True, scope='all', state='opened',
                        assignee_username='derekferguson', **extra_params)
for issue in issues:
    print(issue.title)

How to revert comments Youtube layout?

#see video for details  https://www.youtube.com/watch?v=J0L_nYtNlqs #uBlock Origin  https://chrome.google.com/webstore/detail/ublock-o...