Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Pre-commit hook for verifying jira tickets for gitlab

Divy Tolia
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 11, 2024

We are trying to create a python precommit hook which verifies the jira ticket for us via oauth by creating an app using the jira developer console. However we are unable to collect the code that is returned for authentication to run this.

The script is as follows, I've removed sensitive information for security.


JIRA_BASE_URL = ''
CLIENT_ID = ''
CLIENT_SECRET = ''
REDIRECT_URI = ''
client = WebApplicationClient(CLIENT_ID)

auth_url = client.prepare_request_uri(
authorization_url,
audience='api.atlassian.com',
scope=['read:status:jira'],
redirect_uri=REDIRECT_URI,
state='auth123',
prompt='consent'
)
print(auth_url)
response = requests.get(auth_url)
print(response.url)
# Get access token
token_url = client.prepare_request_body(
code=''
)

0 answers

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events