Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
badges earned

Your Points Tracker
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Export SLA Metrics, goals and Conditions for all projects Edited



I need to export SLA Metrics, Goals, Conditions & Calendars from all Service Desk Projects.
How can I do that? I did't find that data in Database.


Then I tried ServiceDesk java API. But the following code gave me only 1 condition: Issue Created, while I see 3 even in 1 SLA metric (project has 2 metric, 5 different start condition)

What I got from ScriptRunner console:


import com.atlassian.servicedesk.spi.sla.condition.TimeMetricConditionFactory
import com.atlassian.servicedesk.spi.sla.condition.TimeMetricHitCondition
import com.atlassian.servicedesk.spi.sla.condition.TimeMetricMatchCondition
import com.atlassian.jira.util.I18nHelper
import com.onresolve.scriptrunner.runner.customisers.PluginModule
import com.onresolve.scriptrunner.runner.customisers.WithPlugin
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.project.ProjectManager
import com.atlassian.jira.project.Project

TimeMetricConditionFactory timeMetricConditionFactory

def user = ComponentAccessor.jiraAuthenticationContext.loggedInUser
def projectManager = ComponentAccessor.getProjectManager()
Project project = projectManager.getProjectObjByKey("ATLAS")
I18nHelper loc = ComponentAccessor.i18nHelperFactory.getInstance(user)

def metricHitConditions = timeMetricConditionFactory.getAllHitConditions(project)
Iterator<? extends TimeMetricHitCondition> it = metricHitConditions.iterator()
log.error("Count all Hit conditions: ${metricHitConditions.size()}")

while (it.hasNext()) {
TimeMetricHitCondition item =;
log.error("Name of the Hit condition: ${item.getName(loc)}")

def metricMatchConditions = timeMetricConditionFactory.getAllMatchConditions(project)
Iterator<? extends TimeMetricMatchCondition> iter = metricMatchConditions.iterator()
log.error("Count all Match conditions: ${metricMatchConditions.size()}")

while (iter.hasNext()) {
TimeMetricMatchCondition item =;
log.error("Name of the Match condition: ${item.getName(loc)}")


What I need:

Metrics name, when it changed, all conditions and goals (including JQL)



2 answers

1 accepted

1 vote
Answer accepted
Daniel Ebers Community Leader Jun 06, 2021

Hi @Sergey Kislitsyn

based on your description I believe to understand that you do not want to request the SLA data for a specific (customer) request in your service management project but rather the data for configuration of each project, is this correctly understood?

In the REST API reference ( there are only examples that are referring to a single request, raised by a customer.

Also this Suggestion seems only to refer to single issues: (this is the one that in the end links to REST API reference).


Judging from another Suggestion ( which is indeed for Cloud but in the end it will be the same for Jira Server there is no option currently to access all SLA data via API.

Probably somebody has some more tricks but I believe so far when the API exposes not the data in an appropriate way or not at all they cannot be gathered.

Also somebody suggested to expose calendar data via API, which leads me to the assumption, this data is not yet exposed via API.


Hi Sergey,

Coincidentally I'm looking how to retrieve exactly the same information from Service Desk and I'm getting exactly same results unfortunately, i.e. nothing :( Not very encouraging to say the least.


Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Jira Service Management

JSM June Challenge #2: Share how your business teams became ITSM rockstars

For JSM June Challenge #2, share how your non-technical teams like HR, legal, marketing, finance, and beyond started using Jira Service Management! Tell us: Did they ask to start using it or...

354 views 9 7
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you