This project is designed to automate the sending of SMS notifications to a list of recipients whenever specific events occur in a Jira project. It utilizes Jira's webhook feature to trigger an external Flask application, which then sends SMS messages to the specified recipients using the Kavenegar SMS gateway. The application is containerized using Docker for easy deployment and scalability.
- Docker installed on your machine
- A Kavenegar account with an API key
- A list of recipient phone numbers
- Clone the Repository:
git clone https://github.com/mrbooshehri/jira_sms_gateway.git
cd jira_sms_gateway
- Build the Docker Image:
docker build -t jira_sms_gateway .
-
Prepare the Receptor File:
Create a text file named
receptors.txt
in the project directory. Each line should contain a phone number.
Sample receptors.txt:
Admin|John Lenon|09101234567 PMO|David Lenz|09111234567 Devops|Gary More|09121234567 Support|Kurt Cobain|09131234567
- Run the Docker Container:
docker run -p 5000:5000 -e KAVENEGAR_API_KEY=your_api_key \
-e SENDER_NUMBER=your_sender_number -e RECEPTOR_FILE_PATH=receptors.txt \
jira_sms_gateway
Replace
your_api_key
andyour_sender_number
with your actual Kavenegar API key and sender number.
-
Configure Jira Webhook:
In your Jira project, navigate to the webhook settings and create a new webhook. Set the URL to point to the endpoint your Flask application is listening on (e.g.,
http://localhost:5000/webhook
). -
Trigger the Webhook:
Perform an action in Jira that triggers the webhook (e.g., create, update, or transition an issue). The Flask application will receive the webhook notification and send an SMS to each recipient listed in the
receptors.txt
file.
Contributions are welcome! Please feel free to submit pull requests or open issues for any improvements or bug fixes.
This project is licensed under the MIT License. See the LICENSE
file for details.