Uploaded image for project: 'Jira Service Management Data Center'
  1. Jira Service Management Data Center
  2. JSDSERVER-3562

SLA disappears if "Stop" condition refers to a past event

    XMLWordPrintable

Details

    Description

      NOTE: This bug report is for JIRA Service Desk Server. Using JIRA Service Desk Cloud? See the corresponding bug report.

      Summary

      The SLA disappears if the stop condition is set to an event that issue/s have already gone through.

      Steps to Reproduce

      1. Create a new SD project, using the default SLA settings for "Time to response" and "Time to resolution";
      2. Create a new issue under that project and assign it to a user;
      3. Go to the configuration of any SLA and add "Assignee: Changed" as a "Stop" condition;
      4. Go back to the assigned issue, notice the SLA is missing;

      Expected Behavior

      Stop or start the SLA and register completion based on the occurrence of an event. In this case, the SLA of the issue should be stopped and continue showing.

      Actual Behavior

      If you check the missing SLA through the below REST API, you will notice that it has the start and stop events right, with the stop condition matching the event of the assignee changed.

      <JIRA-Base-URL>/rest/servicedesk/1/servicedesk/<Project-Key>/sla/debug/issue/<Issue-Key>/metric/<SLA-ID>/data

      On the other hand, completeSLAData is an empty array. See the example below.

      {
        "timeline": {
          "events": [
            {
              "date": 1480957099020,
              "dateString": "2016-12-05T16:58:19.020Z",
              "types": [
                "START"
              ]
            },
            {
              "date": 1480957273121,
              "dateString": "2016-12-05T17:01:13.121Z",
              "types": [
                "STOP"
              ]
            }
          ]
        },
        "completeSLAData": [],
        "metricId": 88,
        "definitionChangeDate": 1480957283855,
        "definitionChangeMsEpoch": 1480957283855,
        "definitionChangeDateString": "2016-12-05T17:01:23.855Z",
        "customFieldId": 10603,
        "customFieldName": "Time to first response",
        "metricCreatedDate": 1480957098664
      }
      

      Workaround

      A). Manually reconstruct the SLA for this issue, which will use the timestamp of "Stop" event to set the complete SLA data. In order to do so, perform a POST request on <JIRA-Base-URL>/rest/servicedesk/1/servicedesk/sla/admin/task/destructive/reconstruct?force\=true with a JSON array of affected issues.

      See the example below using cURL.

      curl -X POST -H "Content-Type: application/json" -d '["ISSUE-3"]' -u 'admin':'admin' http://localhost:8080/jira/rest/servicedesk/1/servicedesk/sla/admin/task/destructive/reconstruct\?force\=true
      
      Legend

      * ISSUE-3 is the issue key;

      • 'admin':'admin' are the credentials of a System Administrator - 'username':'password';
      • http://localhost:8080/jira/ is JIRA's base URL;

      B). Make a small edit in the SLA rule like adding a minute and update the SLA, this will populate the SLA for all issues affected.

      Attachments

        Issue Links

          Activity

            People

              jxu2@atlassian.com Sam Xu
              vchin Vincent Chin (Inactive)
              Votes:
              23 Vote for this issue
              Watchers:
              29 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Backbone Issue Sync