Monitoring Jira Service Management email channels using REST API

Still need help?

The Atlassian Community is here for you.

Ask the community


Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

Jira Administrators might be interested to monitor Jira Service Management email channels in an automated fashion, so they are able to act immediately when these channels start to experience errors such as authentication failure or connectivity problems.

Environment

Jira Service Management 4.0 or higher.

Solution

Jira Service Management has a private REST API endpoint that can be used for this task. As a general rule, if a public REST API endpoint is not available in Jira, it's interesting to use the Atlassian REST API browser tool, and list all the private endpoints available in the product.

However, private endpoints are not guaranteed to provide consistent outputs in the product after upgrades for example, and can be changed or removed altogether without any deprecation or warnings, as they are intended to be used by the product itself, and not by external services.

EndpointRequest Method
/rest/jira-email-processor-plugin/1.0/mail/audit/connectivity

GET


This endpoint will provide an output with the list of all mail channels within your Jira Service Management application, along with the result status in the last execution, and when the last execution was, as in the example below:


{"data":[{"id":1,"mailConnectionId":1,"mailChannelName":"myaccount@testing.com","failureMessage":"","noOfRetry":0,"runOutcome":"SUCCESS","createdDateTime":"20/Jan/23 11:23 AM","updatedDateTime":"20/Jan/23 11:23 AM"}],"totalPages":1}


The payload can then be ingested in monitoring applications, and create triggers to act when certain columns' values change, such as the runOutcome or the updatedDateTime.

Last modified on Jan 20, 2023

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.