Merge pull request #43 from valueonag/int
solved new api for jira and fixes ui
This commit is contained in:
commit
b59c88fb4e
2 changed files with 7 additions and 6 deletions
|
|
@ -52,7 +52,7 @@ class ConnectorTicketJira(TicketBase):
|
|||
jql_query = f"project={self.project_code} AND issuetype={self.issue_type}"
|
||||
|
||||
# Prepare the request URL and parameters
|
||||
url = f"{self.jira_url}/rest/api/2/search"
|
||||
url = f"{self.jira_url}/rest/api/3/search/jql"
|
||||
params = {"jql": jql_query, "maxResults": 1, "expand": "names"}
|
||||
|
||||
# Prepare authentication
|
||||
|
|
@ -126,7 +126,7 @@ class ConnectorTicketJira(TicketBase):
|
|||
|
||||
# Prepare authentication
|
||||
auth = aiohttp.BasicAuth(self.jira_username, self.jira_api_token)
|
||||
url = f"{self.jira_url}/rest/api/2/search"
|
||||
url = f"{self.jira_url}/rest/api/3/search/jql"
|
||||
|
||||
try:
|
||||
async with aiohttp.ClientSession() as session:
|
||||
|
|
@ -216,7 +216,7 @@ class ConnectorTicketJira(TicketBase):
|
|||
update_data = {"fields": fields}
|
||||
|
||||
# Make the update request
|
||||
url = f"{self.jira_url}/rest/api/2/issue/{task_id}"
|
||||
url = f"{self.jira_url}/rest/api/3/issue/{task_id}"
|
||||
|
||||
async with session.put(
|
||||
url, json=update_data, headers=headers, auth=auth
|
||||
|
|
|
|||
|
|
@ -183,6 +183,9 @@ async def login(
|
|||
async def auth_callback(code: str, state: str, request: Request) -> HTMLResponse:
|
||||
"""Handle Google OAuth callback"""
|
||||
try:
|
||||
# Import Token at function level to avoid scoping issues
|
||||
from modules.interfaces.interfaceAppModel import Token
|
||||
|
||||
# Parse state
|
||||
state_data = json.loads(state)
|
||||
state_type = state_data.get("type", "login")
|
||||
|
|
@ -232,7 +235,6 @@ async def auth_callback(code: str, state: str, request: Request) -> HTMLResponse
|
|||
rootInterface = getRootInterface()
|
||||
# Prefer connection flow reuse; fallback to user access token
|
||||
if connection_id:
|
||||
from modules.interfaces.interfaceAppModel import Token
|
||||
existing_tokens = rootInterface.db.getRecordset(Token, recordFilter={
|
||||
"connectionId": connection_id,
|
||||
"authority": AuthAuthority.GOOGLE
|
||||
|
|
@ -325,7 +327,6 @@ async def auth_callback(code: str, state: str, request: Request) -> HTMLResponse
|
|||
jwt_token, jwt_expires_at = createAccessToken(jwt_token_data)
|
||||
|
||||
# Create JWT token
|
||||
from modules.interfaces.interfaceAppModel import Token
|
||||
token = Token(
|
||||
userId=user.id, # Use local user's ID
|
||||
authority=AuthAuthority.GOOGLE,
|
||||
|
|
@ -444,7 +445,7 @@ async def auth_callback(code: str, state: str, request: Request) -> HTMLResponse
|
|||
connection.externalEmail = user_info.get("email")
|
||||
|
||||
# Update connection record directly
|
||||
from modules.interfaces.interfaceAppModel import UserConnection, Token
|
||||
from modules.interfaces.interfaceAppModel import UserConnection
|
||||
rootInterface.db.recordModify(UserConnection, connection_id, connection.to_dict())
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue