@@ -1812,3 +1812,139 @@ def updateperms(self, user, action, groups):
18121812 }
18131813
18141814 return self ._backend .user_update (update )
1815+
1816+
1817+ #############################
1818+ # ExternalBugs API wrappers #
1819+ #############################
1820+
1821+ def add_external_tracker (self , bug_ids , ext_bz_bug_id , ext_type_id = None ,
1822+ ext_type_description = None , ext_type_url = None ,
1823+ ext_status = None , ext_description = None ,
1824+ ext_priority = None ):
1825+ """
1826+ Wrapper method to allow adding of external tracking bugs using the
1827+ ExternalBugs::WebService::add_external_bug method.
1828+
1829+ This is documented at
1830+ https://bugzilla.redhat.com/docs/en/html/api/extensions/ExternalBugs/lib/WebService.html#add_external_bug
1831+
1832+ bug_ids: A single bug id or list of bug ids to have external trackers
1833+ added.
1834+ ext_bz_bug_id: The external bug id (ie: the bug number in the
1835+ external tracker).
1836+ ext_type_id: The external tracker id as used by Bugzilla.
1837+ ext_type_description: The external tracker description as used by
1838+ Bugzilla.
1839+ ext_type_url: The external tracker url as used by Bugzilla.
1840+ ext_status: The status of the external bug.
1841+ ext_description: The description of the external bug.
1842+ ext_priority: The priority of the external bug.
1843+ """
1844+ param_dict = {'ext_bz_bug_id' : ext_bz_bug_id }
1845+ if ext_type_id is not None :
1846+ param_dict ['ext_type_id' ] = ext_type_id
1847+ if ext_type_description is not None :
1848+ param_dict ['ext_type_description' ] = ext_type_description
1849+ if ext_type_url is not None :
1850+ param_dict ['ext_type_url' ] = ext_type_url
1851+ if ext_status is not None :
1852+ param_dict ['ext_status' ] = ext_status
1853+ if ext_description is not None :
1854+ param_dict ['ext_description' ] = ext_description
1855+ if ext_priority is not None :
1856+ param_dict ['ext_priority' ] = ext_priority
1857+ params = {
1858+ 'bug_ids' : listify (bug_ids ),
1859+ 'external_bugs' : [param_dict ],
1860+ }
1861+
1862+ log .debug ("Calling ExternalBugs.add_external_bug(%s)" , params )
1863+ return self ._backend .externalbugs_add (params )
1864+
1865+ def update_external_tracker (self , ids = None , ext_type_id = None ,
1866+ ext_type_description = None , ext_type_url = None ,
1867+ ext_bz_bug_id = None , bug_ids = None ,
1868+ ext_status = None , ext_description = None ,
1869+ ext_priority = None ):
1870+ """
1871+ Wrapper method to allow adding of external tracking bugs using the
1872+ ExternalBugs::WebService::update_external_bug method.
1873+
1874+ This is documented at
1875+ https://bugzilla.redhat.com/docs/en/html/api/extensions/ExternalBugs/lib/WebService.html#update_external_bug
1876+
1877+ ids: A single external tracker bug id or list of external tracker bug
1878+ ids.
1879+ ext_type_id: The external tracker id as used by Bugzilla.
1880+ ext_type_description: The external tracker description as used by
1881+ Bugzilla.
1882+ ext_type_url: The external tracker url as used by Bugzilla.
1883+ ext_bz_bug_id: A single external bug id or list of external bug ids
1884+ (ie: the bug number in the external tracker).
1885+ bug_ids: A single bug id or list of bug ids to have external tracker
1886+ info updated.
1887+ ext_status: The status of the external bug.
1888+ ext_description: The description of the external bug.
1889+ ext_priority: The priority of the external bug.
1890+ """
1891+ params = {}
1892+ if ids is not None :
1893+ params ['ids' ] = listify (ids )
1894+ if ext_type_id is not None :
1895+ params ['ext_type_id' ] = ext_type_id
1896+ if ext_type_description is not None :
1897+ params ['ext_type_description' ] = ext_type_description
1898+ if ext_type_url is not None :
1899+ params ['ext_type_url' ] = ext_type_url
1900+ if ext_bz_bug_id is not None :
1901+ params ['ext_bz_bug_id' ] = listify (ext_bz_bug_id )
1902+ if bug_ids is not None :
1903+ params ['bug_ids' ] = listify (bug_ids )
1904+ if ext_status is not None :
1905+ params ['ext_status' ] = ext_status
1906+ if ext_description is not None :
1907+ params ['ext_description' ] = ext_description
1908+ if ext_priority is not None :
1909+ params ['ext_priority' ] = ext_priority
1910+
1911+ log .debug ("Calling ExternalBugs.update_external_bug(%s)" , params )
1912+ return self ._backend .externalbugs_update (params )
1913+
1914+ def remove_external_tracker (self , ids = None , ext_type_id = None ,
1915+ ext_type_description = None , ext_type_url = None ,
1916+ ext_bz_bug_id = None , bug_ids = None ):
1917+ """
1918+ Wrapper method to allow removal of external tracking bugs using the
1919+ ExternalBugs::WebService::remove_external_bug method.
1920+
1921+ This is documented at
1922+ https://bugzilla.redhat.com/docs/en/html/api/extensions/ExternalBugs/lib/WebService.html#remove_external_bug
1923+
1924+ ids: A single external tracker bug id or list of external tracker bug
1925+ ids.
1926+ ext_type_id: The external tracker id as used by Bugzilla.
1927+ ext_type_description: The external tracker description as used by
1928+ Bugzilla.
1929+ ext_type_url: The external tracker url as used by Bugzilla.
1930+ ext_bz_bug_id: A single external bug id or list of external bug ids
1931+ (ie: the bug number in the external tracker).
1932+ bug_ids: A single bug id or list of bug ids to have external tracker
1933+ info updated.
1934+ """
1935+ params = {}
1936+ if ids is not None :
1937+ params ['ids' ] = listify (ids )
1938+ if ext_type_id is not None :
1939+ params ['ext_type_id' ] = ext_type_id
1940+ if ext_type_description is not None :
1941+ params ['ext_type_description' ] = ext_type_description
1942+ if ext_type_url is not None :
1943+ params ['ext_type_url' ] = ext_type_url
1944+ if ext_bz_bug_id is not None :
1945+ params ['ext_bz_bug_id' ] = listify (ext_bz_bug_id )
1946+ if bug_ids is not None :
1947+ params ['bug_ids' ] = listify (bug_ids )
1948+
1949+ log .debug ("Calling ExternalBugs.remove_external_bug(%s)" , params )
1950+ return self ._backend .externalbugs_remove (params )
0 commit comments