Forums

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

Automate sending emails using python

Priyadarshini R
August 26, 2026

Hi friends,

 

I am writing a python script to send weekly emails in the emails I will be sending a report related to SLAs . It is a custom report. Has anyone tried sending the automatic emails using python. 

 

Priya R

2 answers

4 votes
Tomislav Tobijas
Community Champion
August 27, 2026

Hey @Priyadarshini R ,

Are you planning to do any transformations or summaries of those SLAs? Meaning, if you're pulling things directly from JSM you can use the following API endpoint: JSM Cloud / REST API / Get sla information 

GET /rest/servicedeskapi/request/<issue-key-or-id>/sla

But this will get/pull info directly from a specific work item/ticket. If you need a 'report,' you'd need to aggregate things somewhere. 👀

Alternatively, you could use Jira automation and something like this:

  1. Trigger: Go to Project settings > Automation and create a rule with a Scheduled trigger set to run weekly

  2. Fetch Data: Add a Lookup issues action and enter the JQL query for your SLA report (e.g., fetching tickets that breached their SLA)

  3. Send Email: Add a Send email action. You can format the email body using HTML and smart values like {{#lookupIssues}} to iterate through the results and build a structured table for your report

A similar concept using a JQL query might work with Python.. but that's the approach I'd maybe use or at least try 🤔

Cheers,
Tobi

Priyadarshini R
August 27, 2026

Hi @Tomislav Tobijas 

I will be using python to do custom calculations. There is one service customer portal where users will be using that portal to raise tickets related to many applications like Jira, Prohance, Company Dashboard. Each team handles each applications. So I need to provide a Report for SLA percentage for each team like Jira Prohance etc etc.

Priya R

Like Tomislav Tobijas likes this
0 votes
Gor Greyan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
August 27, 2026

Hi @Priyadarshini R
Welcome to the Atlassian Community!

One thing to clarify: where is the SLA data for your custom report coming from? If you're using native JSM SLAs, an SLA Marketplace app, or calculating the SLA yourself, the API/data retrieval part will be different.

You can query the required Jira issues using the REST API and authenticate with an API token. For sending the email, you could use your organization's SMTP server or an API such as Microsoft Graph if you're using Microsoft 365.

Priyadarshini R
August 27, 2026

Hi @Gor Greyan 

Thanks for your reply is it mandatory to use SMTP server or Microsoft Graph to send emails. I am using JSM SLAs. In python we are using JQL to get the total number of breached tickets and we will caluclate the SLA percentage by some formula. But the point is how to make the python send emails ?

 

Priya R

Gor Greyan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
August 27, 2026

@Priyadarshini R

No, Microsoft Graph specifically is not mandatory. But Python itself isn't a mail server, so it still needs an email service/provider to deliver the message.

Jira REST API → run your JQL → calculate the SLA percentage → build the report → send the email

For the last step, you could use your organization's SMTP server, Microsoft Graph if you're on Microsoft 365, or another email API/service available in your environment.

You can use Python's built-in smtplib if your mail system allows authenticated SMTP, so you don't necessarily need an additional Python package.

Since you're using native JSM SLAs, you can retrieve the Jira/JSM data through the REST APIs and perform your SLA calculations in Python.

Like # people like this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin Site Admin
TAGS
AUG Leaders

Atlassian Community Events