You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/tools.py
+13-1Lines changed: 13 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -52,7 +52,8 @@ async def list_jira_issues(
52
52
status: Optional[str] =None,
53
53
priority: Optional[str] =None,
54
54
limit: int=50,
55
-
search_text: Optional[str] =None
55
+
search_text: Optional[str] =None,
56
+
timeframe: int=30
56
57
) ->Dict[str, Any]:
57
58
"""
58
59
@@ -63,6 +64,7 @@ async def list_jira_issues(
63
64
priority: Filter by priority ID
64
65
limit: Maximum number of issues to return (default: 50)
65
66
search_text: Search in summary and description fields
67
+
timeframe: Filter issues updated/created/resolved within last N days (default: 30)
66
68
67
69
Returns:
68
70
Dictionary containing issues list and metadata
@@ -92,6 +94,15 @@ async def list_jira_issues(
92
94
search_condition=f"(LOWER(SUMMARY) LIKE '%{sanitize_sql_value(search_text.lower())}%' OR LOWER(DESCRIPTION) LIKE '%{sanitize_sql_value(search_text.lower())}%')"
93
95
sql_conditions.append(search_condition)
94
96
97
+
# Add timeframe filter - check if any of the dates are within the specified timeframe
98
+
iftimeframe>0:
99
+
timeframe_condition=f"""(
100
+
CREATED >= CURRENT_DATE() - INTERVAL '{timeframe} DAYS'
101
+
OR UPDATED >= CURRENT_DATE() - INTERVAL '{timeframe} DAYS'
102
+
OR RESOLUTIONDATE >= CURRENT_DATE() - INTERVAL '{timeframe} DAYS'
103
+
)"""
104
+
sql_conditions.append(timeframe_condition)
105
+
95
106
where_clause=""
96
107
ifsql_conditions:
97
108
where_clause="WHERE "+" AND ".join(sql_conditions)
0 commit comments