Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Calendar Rest API

Panel
bgColor#DEEBFF

Click here to reach Calendar REST API.

...

Next-Gen SLA Rest API

Panel
bgColor#DEEBFF

Click here to reach Next-Gen SLA REST API.

...

Additional Time to SLA Rest API

Panel
bgColor#DEEBFF

Click here to reach REST API.

Saving SLA definition

Method

POST

URL

/rest/tts-api/latest/sla

...

Responses for: /rest/tts-api/latest/sla/search?description=Urgent&slaValueAsTimeString=20m

[
    {
       "id":24,
       "description":"Urgent Handle",
       "workflowName":"TTS Project Workflow",
       "priorityId":"1",
       "originStatusId":[1],
       "targetStatusId":[3],
       "slaValueAsTimeString":"20m",
       "jqlString":"",
       "pauseSlaArray":[
  
       ],
       "empty":false
    }
]

...

Listing all SLA definitions

Method

GET

URL

/rest/tts-api/latest/sla/allSlas

Possible Response

[
    {
       "id":24,
       "description":"Urgent Handle",
       "workflowName":"TTS Project Workflow",
       "priorityId":"1",
       "originStatusId":[1],
       "targetStatusId":[3],
       "slaValueAsTimeString":"20m",
       "jqlString":"",
       "pauseSlaArray":[
  
       ],
       "empty":false
    },
    {
       "id":25,
       "description":"Urgent Fix",
       "workflowName":"TTS Project Workflow",
       "priorityId":"1",
       "originStatusId":[3],
       "targetStatusId":[5],
       "slaValueAsTimeString":"1h",
       "jqlString":"",
       "pauseSlaArray":[
  
       ],
       "empty":false
    },
    {
       "id":28,
       "description":"Trivial Finalize",
       "workflowName":"TTS Project Workflow",
       "priorityId":"5",
       "originStatusId":[1],
       "targetStatusId":[6],
       "slaValueAsTimeString":"1d",
       "jqlString":"",
       "pauseSlaArray":[
          1
       ],
       "empty":false
    },
    {
       "id":26,
       "description":"Normal Resolve",
       "workflowName":"TTS Project Workflow",
       "originStatusId":[1],
       "targetStatusId":[5],
       "slaValueAsTimeString":"4h",
       "workingTimeId":1,
       "jqlString":"priority != Blocker",
       "pauseSlaArray":[
  
       ],
       "empty":false
    },
    {
       "id":30,
       "description":"Multiple Status SLA",
       "workflowName":"TTS Project Workflow",
       "originStatusId":[1,4],
       "targetStatusId":[5,6],
       "slaValueAsTimeString":"10m",
       "jqlString":"issuekey = TP-29",
       "pauseSlaArray":[
  
       ],
       "empty":false
    }
]

...

Updating SLA definition

Method

POST

URL

/rest/tts-api/latest/sla

...

Possible Responses

{"success":true,"message":"Deleted slaId with 25"}

...

Get SLA details for an issue

Method

GET

URL

/rest/tts-api/1.0/sla/issue/{issue-key}

...

No SLA ID is given

[
  {
    "paused": false,
    "endDate": "2017-11-03T10:35:22Z",
    "slaTargetSourceName": "Resolved",
    "inNonWorkingDays": false,
    "notMuchTime": 80,
    "formattedWorkingDuration": "1d 1h 35m 22s",
    "formattedRemainingDuration": "6h 24m 38s",
    "slaStatus": "SUCCESS",
    "synchronizing": false,
    "remainingDuration": "PT22H24M38S",
    "elapsedPercentage": 53,
    "class": "class com.tuncaysenturk.jira.plugins.dto.IssueSlaDetailsDto",
    "slaValue": "PT48H",
    "slaOriginSourceName": "Open",
    "inNonWorkingHours": false,
    "slaName": "Resolution Time",
    "workingDuration": "PT25H35M22S",
    "slaId": 0,
    "targetDate": "2017-12-02T09:30:00Z",
    "slaValueType": "SLA_VALUE",
    "started": true,
    "finished": false,
    "workingCalendarName": "8-5 Business Hours",
    "slaOriginType": "STATUS",
    "inCriticalZone": true,
    "slaValueSourceName": "SLA Value",
    "slaTargetType": "STATUS",
    "startDate": "2017-10-02T09:30:00Z",
    "slaValueAsDurationString": "2d"
  },
  {
    "paused": false,
    "endDate": "2017-12-03T10:35:22Z",
    "formattedOverdueDuration": "1d 1h 35m 22s",
    "slaTargetSourceName": "Resolved",
    "inNonWorkingDays": false,
    "notMuchTime": 80,
    "formattedWorkingDuration": "2d 1h 35m 22s",
    "slaStatus": "EXCEED",
    "synchronizing": false,
    "elapsedPercentage": 100,
    "class": "class com.tuncaysenturk.jira.plugins.dto.IssueSlaDetailsDto",
    "slaValue": "PT48H",
    "slaOriginSourceName": "Open",
    "inNonWorkingHours": false,
    "slaName": "Resolution Time",
    "workingDuration": "PT49H35M22S",
    "slaId": 0,
    "overdueDuration": "PT1H35M22S",
    "targetDate": "2017-12-02T09:30:00Z",
    "slaValueType": "SLA_VALUE",
    "started": true,
    "finished": false,
    "workingCalendarName": "8-5 Business Hours",
    "slaOriginType": "STATUS",
    "inCriticalZone": true,
    "slaValueSourceName": "SLA Value",
    "slaTargetType": "STATUS",
    "startDate": "2017-10-02T09:30:00Z",
    "slaValueAsDurationString": "2d"
  }
]

...

Get SLA details for issues based on JQL

Method

GET

URL

/rest/tts-api/1.0/sla/issue/

...

Result

{
    "totalIssues": 49,
    "pagesCount": 5,
    "start": 0,
    "niceStart": 1,
    "end": 10,
    "nextStart": 10,
    "previousStart": 0,
    "slas": [
        {
            ....// same REST response as above service
        },
        {
            ....// same REST response as above service
        }
    ]
}

...

Get 'Time to SLA' field for the issue

Method

GET

URL

/rest/tts-api/1.0/sla/timeToSla/{issue-key}

...

Possible Responses

[
     {
          "slaId": 25,
          "slaName": "Urgent Fix",
          "originStatusName": "In Progress",
          "targetStatusName": "Resolved",
          "slaValue": 60,
          "slaValueAsString": "1h",
          "statusDate": 1431931844500,
          "targetDate": 1431935444500,
          "overdue": "(SLA Overdue) 3 hours, 55 minutes, 51 seconds"
     }
]

...

Get 'SLA Overview' data for the issue

Method

GET

URL

/rest/tts-api/latest/sla/overview/{issue-key}

Possible Responses

[
    {
        "timePerformed":1457004154795,
        "workingDuration":"46 minutes, 10 seconds",
        "workingDurationAsSeconds":2770,
        "pausedDuration":"0",
        "slaValueAsTimeString":"20m",
        "status":"EXCEED",
        "breachString":"26 minutes, 10 seconds",
        "originDate":1457004154795,
        "statusDate":1457004154795,
        "expectedTargetDate":1457005354795,
        "actualTargetDate":1431954304511,
        "slaName":"Urgent Handle"
    },
    {
        "timePerformed":1457004154795,
        "workingDuration":"46 minutes, 10 seconds",
        "workingDurationAsSeconds":2770,
        "pausedDuration":"0",
        "slaValueAsTimeString":"1h",
        "status":"STILL",
        "originDate":1457004154795,
        "statusDate":1457004154795,
        "expectedTargetDate":1457007754795,
        "actualTargetDate":1431954357960,
        "slaName":"Urgent Fix"
    }
]

...

Generating SLA data for existing issues

Method

GET

URL

/rest/tts-api/latest/sla/regenerate/{issue-key}

Possible Responses

{"success":false,"message":"Issue not exists: TTS-313"}
{"success":false,"message":"Unauthorized user"}
{"success":true,"message":""}

...

Resetting SLA

Method

POST

URL

/rest/tts-api/latest/sla/reset/{issue-id}/{sla-id}

POST form param

"date=timeAsMillis"  (as long, time millis, optional, if not set current time will be used)

...

Possible Responses

{"success":true,"message":""}
{"success":true,"message":"There are no generated SLA data for issue: TTS-313"}
{"success":false,"message":"Unauthorized user"}
{"success":false,"message":"Issue not exists: TTS-313"}

...

Get SLA History

Method

GET

URL

{{baseUrl}}/rest/tts-api/1.0/sla-history-new?issueId=10400&slaId=339