Skip to content

Commit

Permalink
[PR #7847/8ea58618 backport][stable-8] gitlab_issue: use search inste…
Browse files Browse the repository at this point in the history
…ad of title (#7977)

gitlab_issue: use search instead of title (#7847)

* gitlab_issue: use search instead of title

* Create changelog file

* Update changelogs/fragments/7847-gitlab-issue-title.yml

Co-authored-by: Felix Fontein <[email protected]>

* using query_parameters

Co-authored-by: Nejc Habjan <[email protected]>

* sanity checks

---------

Co-authored-by: Felix Fontein <[email protected]>
Co-authored-by: Nejc Habjan <[email protected]>
(cherry picked from commit 8ea5861)

Co-authored-by: Gabriele Pongelli <[email protected]>
  • Loading branch information
patchback[bot] and gpongelli authored Feb 17, 2024
1 parent 8eec476 commit 359788e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions changelogs/fragments/7847-gitlab-issue-title.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- gitlab_issue - fix behavior to search GitLab issue, using ``search`` keyword instead of ``title`` (https://github.com/ansible-collections/community.general/issues/7846).
2 changes: 1 addition & 1 deletion plugins/modules/gitlab_issue.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ def get_milestone(self, milestone_id, group):
def get_issue(self, title, state_filter):
issues = []
try:
issues = self.project.issues.list(title=title, state=state_filter)
issues = self.project.issues.list(query_parameters={"search": title, "in": "title", "state": state_filter})
except gitlab.exceptions.GitlabGetError as e:
self._module.fail_json(msg="Failed to list the Issues: %s" % to_native(e))

Expand Down

0 comments on commit 359788e

Please sign in to comment.