@@ -3559,7 +3559,10 @@ def jql(
3559
3559
params ["expand" ] = expand
3560
3560
if validate_query is not None :
3561
3561
params ["validateQuery" ] = validate_query
3562
- url = self .resource_url ("search" )
3562
+ if self .cloud :
3563
+ url = self .resource_url ("search" )
3564
+ else :
3565
+ url = self .resource_url ("search/jql" )
3563
3566
return self .get (url , params = params )
3564
3567
3565
3568
def enhanced_jql (
@@ -3619,6 +3622,39 @@ def approximate_issue_count(
3619
3622
url = self .resource_url ("search/approximate-count" )
3620
3623
return self .post (url , data )
3621
3624
3625
+ def match_jql (self , issue_ids : List [int ], jqls : List [str ]) -> Optional [dict [Any , Any ]]:
3626
+ """
3627
+ Checks which issues match a list of JQL queries.
3628
+
3629
+ This method corresponds to the /rest/api/3/jql/match endpoint.
3630
+ It helps you verify if a set of issues would be returned by given JQL queries.
3631
+
3632
+ :param issue_ids: A list of issue IDs to be checked against the JQLs.
3633
+ :param jqls: A list of JQL query strings to match.
3634
+ :return: A dictionary containing the matching results from the API.
3635
+ For example:
3636
+ {
3637
+ "errors": [],
3638
+ "results": [
3639
+ {
3640
+ "matchedIssues": [10001],
3641
+ "errors": [],
3642
+ "jql": "project = FOO"
3643
+ },
3644
+ {
3645
+ "matchedIssues": ,
3646
+ "errors": [],
3647
+ "jql": "issuetype = Bug"
3648
+ }
3649
+ ]
3650
+ }
3651
+ """
3652
+ if not self .cloud :
3653
+ raise ValueError ("``approximate_issue_count`` method is only available for Jira Cloud platform" )
3654
+ payload = {"issueIds" : issue_ids , "jqls" : jqls }
3655
+ url = self .resource_url ("jql/match" )
3656
+ return self .post (url , data = payload )
3657
+
3622
3658
def jql_get_list_of_tickets (
3623
3659
self ,
3624
3660
jql : str ,
@@ -3665,7 +3701,10 @@ def jql_get_list_of_tickets(
3665
3701
params ["expand" ] = expand
3666
3702
if validate_query is not None :
3667
3703
params ["validateQuery" ] = validate_query
3668
- url = self .resource_url ("search" )
3704
+ if self .cloud :
3705
+ url = self .resource_url ("search" )
3706
+ else :
3707
+ url = self .resource_url ("search/jql" )
3669
3708
3670
3709
results : List [object ] = []
3671
3710
while True :
0 commit comments