How to find the usage of SLA fields in Jira Service Manager

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

プラットフォームについて: Server および Data Center のみ。この記事は、Server および Data Center プラットフォームのアトラシアン製品にのみ適用されます。

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.

*Fisheye および Crucible は除く

    

要約

This article offers ways to find which SLA fields are in use or unused in Jira Service Manager formerly Jira Service Desk).


環境

All versions of Jira Service Desk/Manager 3.x and 4.x .


ソリューション

We can assess the usage of SLA fields in two ways: JQL in one-by-one or through SQL.

By "SLA in use", we mean "if any existing issue has any value for that SLA field".

JQL one-by-one

For each SLA custom field, you can execute this JQL:

"My SLA 1" = running() or "My SLA 1" != running()

If no issues are listed, the SLAs are not in use.

SQL to find SLA in use

This SQL query lists all fields that are or once were in use (i.e. have any value):

select distinct cf.cfname
from customfield cf
join customfieldvalue cfv on cfv.customfield = cf.id
where cf.customfieldtypekey = 'com.atlassian.servicedesk:sd-sla-field'
and cfv.textvalue like '%"events":[{%';

SQL to find unused SLA

Using the query above as an exclusion, we can list all SLA fields that aren't and have never been used:

select distinct cf.cfname
from customfield cf
where cf.customfieldtypekey = 'com.atlassian.servicedesk:sd-sla-field'
and cf.id not in (
  select cf2.id 
  from customfield cf2, customfieldvalue cfv 
  where cf2.customfieldtypekey = 'com.atlassian.servicedesk:sd-sla-field'
  and cfv.customfield = cf2.id
  and cfv.textvalue like '%"events":[{%'
);

If a field was only used by issues that were deleted, it'll show up as unused.

Deleting the unused SLA fields

These locked custom fields can be deleted through Jira itself only once no project's using them — even if no issue's using them.

You can go project-by-project in Jira or use this query for each SLA to filter the projects that need the SLA removed:

select distinct p.pname
from project p
join jiraissue i on i.project = p.id
join customfieldvalue cfv on cfv.issue = i.id
join customfield cf on cf.id = cfv.customfield
where cf.cfname = 'My SLA 1' -- replace here for your SLA's custom field name
and cfv.textvalue like '%"events":%';

You should go on each project's admin page, select SLAs and then Delete SLA.

Then follow our documentation on Managing SLA data to clean up (delete) the unused fields.

(warning) Note about the SLA clean-up functionality:

  • from Jira Service Management 3.0.0 up to 4.21.x, the SLA clean up can be done from ⚙ > Applications > JIRA SERVICE DESK > Configuration > SLA Names

  • from Jira Service Management 4.22.0, the SLA clean up can be done from ⚙ > Applications > JIRA SERVICE MANAGEMENT > SLA Configuration > General SLA Settings > Configure




最終更新日 2023 年 4 月 3 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.