Hi there!
I need all the help the community can give me with this issue.
I have an automation rule which works with a Webhook as a trigger. After that is triggered, it has to create an issue.
I'm connecting Whatsapp with GPT, sending those reponses to a FLASK server and from then I'm creating a issue with the information.
The problem that I'm having is that when I finish the conversation from the chatbot and send the information to the FLASK server and from then to the JSM, I'm getting this error on the audit log of the automation rule:
I believe this is because there is something wrong with my JSON:
headers = {
'Content-Type': 'application/json',
'Authorization': f'Bearer {jira_auth_token}' # Use Bearer token for authorization
}
payload = {
"fields": {
"summary": f"New candidate: {data['name']}",
"description": f"Name: {data['name']}\nEmail: {data['email']}\nPhone: {data['phone']}\nExperience: {data['experience']}",
"issuetype": {
"name": "Task"
},
"project": {
"key": "FT" # Replace with your actual project key
}
}
}
@app.route("/webhook", methods=['POST'])
def webhook():
incoming_msg = request.form.get('Body')
client_number = request.form.get('From')
user_id = client_number
ai_response = process_message(user_id, incoming_msg)
response = MessagingResponse()
response.message(ai_response)
return str(response)
@app.route("/")
def index():
return "Hello, this is the Flask application running!"
In case you need more information in order to help me please fill free to ask.
Thanks for all the help in advance!
I was making the mistake of thinking I needed an automation rule for creating an issue. But that was really not necessary, I just had to use the API Res URL from my project and give the JSON the correct format.
In case you have any doubts this is how I did it:
def create_jira_issue(data):
auth = HTTPBasicAuth(jira_email, jira_auth_token)
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
payload = {
"fields": {
"summary": f"New candidate: {data['name']}",
"description": f"Name: {data['name']}\nEmail: {data['email']}\nPhone: {data['phone']}\nExperience: {data['experience']}",
"issuetype": {
"name": "Tarea"
},
"project": {
"key": "FT"
}
}
}
@Juan Pablo CabreraCan you share your webhook configuration? I guess you need to use the option "No issues from the webhook", because you want to create a new issue instead of updating an existing one.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Adolfo. What you are saying is true. I actually already solved this problem. As you mentioned, with the automation rule, I was trying to edit an existing rule rather than creating one. So when I realized that, I made the necessary changes pointing my FLASK server now to the project URL and not the WebHook URL.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.