Sending attachments to Viber
The Viber API does not support direct file uploads to its servers. To enable attachment delivery via Viber, this plugin uses Cloudflare R2 as a secure, scalable object storage backend. If you plan to forward attachments from Jira Service Management (JSM) to Viber, you must first configure integration with Cloudflare R2.
Why Cloudflare R2?
- No egress fees: Unlike traditional cloud storage, R2 offers zero data egress costs. You can find detailed pricing information here.
- Global performance: Fast delivery via Cloudflare's edge network.
- Lifecycle rules: Automatically delete files after a set period to reduce storage costs and comply with data retention policies.
How to Set Up Cloudflare R2
1. Register with Cloudflare
- Visit Cloudflare.com and create an account.
- Verify your email and log in to the dashboard.
2. Create an R2 bucket
- On your Cloudflare dashboard.
- Select your account → R2 → "Create Bucket".
- Choose a unique bucket name (e.g.,
jsm-viber-attachments).
3. Generate API credentials
- In the R2 dashboard, go to "Manage R2 API Tokens".
- Create a new token with read/write permissions for your bucket.
- Copy the Access Key ID and Secret Access Key.
4. Configure lifecycle rules (optional but recommended)
- In your bucket settings, add a rule to delete files after a specific number of hours or days (e.g., 24 hours).
- This ensures temporary file links expire and storage is automatically cleaned up.
Plugin Configuration
On the JSM Attachments settings page fill in the following R2 configuration fields:
| Field | Description |
|---|---|
| Endpoint | Your R2 endpoint (e.g., https://<account-id>.r2.cloudflarestorage.com) |
| Bucket Name | The name of your R2 bucket (e.g., jsm-viber-attachments) |
| Access Key ID | From your R2 API token |
| Secret Access Key | From your R2 API token |
| File URL Expires in (hours) | How long the file link remains valid (e.g., 24) |
After saving R2 settings - enable the toggle Forward attachments from JSM to Viber.
Once configured, attachments from JSM issues will be uploaded to R2 and shared with Viber users via expiring download links.
The expiring download links ensure that temporary file access is automatically revoked after the specified time period, maintaining security and reducing unnecessary storage usage.