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

Your Points Tracker
Challenges
Leaderboard
  • 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
Recognition
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?
Kudos
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

Hello

 

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:

photo_2021-06-01_15-00-45.jpg

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

@WithPlugin("com.atlassian.servicedesk")
@PluginModule
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 = it.next();
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 = iter.next();
log.error("Name of the Match condition: ${item.getName(loc)}")
}

 

What I need:

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

photo_2021-06-01_14-58-56.jpg

 

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 (https://docs.atlassian.com/jira-servicedesk/REST/4.17.0/) 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:
https://jira.atlassian.com/browse/JSDSERVER-2001 (this is the one that in the end links to REST API reference).

 

Judging from another Suggestion (https://jira.atlassian.com/browse/JSDCLOUD-9973) 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.

https://jira.atlassian.com/browse/JSDSERVER-5623

Cheers,
Daniel

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.

Cheers,
MiPr

Suggest an answer

Log in or Sign up to answer
TAGS
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