Skip to content

Commit 896c842

Browse files
Siryu6Guillaume Grabé
andauthored
adding products_types API call on V2 Api (#66)
Co-authored-by: Guillaume Grabé <guilaume.grabe@protonmail.com>
1 parent 087302c commit 896c842

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

defectdojo_api/defectdojo_apiv2.py

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ def set_test(self, test_id, engagement_id=None, test_type=None,
537537

538538
if percent_complete:
539539
data['percent_complete'] = percent_complete
540-
540+
541541
if title:
542542
data['title'] = title
543543

@@ -1220,6 +1220,31 @@ def list_jira_issues(self, finding_id=None, jira_key=None, limit=100, offset=0):
12201220

12211221
return self._request('GET', 'jira_finding_mappings/', params)
12221222

1223+
def list_products_type(self, id=None, name=None, limit=100, offset=0):
1224+
"""
1225+
Retrieves product types
1226+
1227+
:param id: Search for a specific product type ID
1228+
:param name: Search a specific product type key
1229+
:param limit: Number of records to return.
1230+
:param offset: The initial index from which to return the result
1231+
"""
1232+
1233+
params = {}
1234+
if id:
1235+
params['id'] = id
1236+
1237+
if name:
1238+
params['name'] = name
1239+
1240+
if limit:
1241+
params['limit'] = limit
1242+
1243+
if offset:
1244+
params['offset'] = offset
1245+
1246+
return self._request('GET', 'product_types/', params)
1247+
12231248
# Utility
12241249

12251250
@staticmethod

0 commit comments

Comments
 (0)