Page tree
Skip to end of metadata
Go to start of metadata

 

Saving SLA definition

MethodPOST
URL/rest/tts-api/latest/sla

Sample results:

{"success":false,"message":"Failed when saving SLA: All fields cannot be empty"}
{"success":true,"message":"35"}
  • Origin and target dates are custom fields

    POST data
    {  
        "description":"Description of the SLA definition",
        "workflowName":"Workflow name",
        "slaStartDateField":10900, // date custom field Id
        "slaEndDateField":10901,   // date custom field Id
        "slaValueAsTimeString":"3h",
        "jqlString":"",
        "workingTimeId":-1, // -1 for 7x24, or workingCalendarId
        "multipleTransition":true,
        "onlyFirstExecution":false
    }
    Possible responses
    {"success":true,"message":"34"}
    {"success":false,"message":"Failed when saving SLA: At least slaStartDateField or originStatusId should be provided"}
  • With negotiation time

    POST data
    {  
        "description":"Description of the SLA definition",
        "workflowName":"Workflow name",
        "originStatusId":[1],
        "targetStatusId":[6],
        "slaNegotiationDateIssueFieldKey":"duedate",
        "jqlString":"",
        "workingTimeId":-1, // -1 for 7x24, or workingCalendarId
        "multipleTransition":true,
        "onlyFirstExecution":false
    }
    Possible responses
    {"success":true,"message":"34"}
    {"success":false,"message":"Failed when saving SLA: At least slaStartDateField or originStatusId should be provided"}
  • With pauses

    POST data
    {  
        "description":"Description of the SLA definition",
        "workflowName":"Workflow name",
        "originStatusId":[1],
        "targetStatusId":[6],
        "slaNegotiationDateIssueFieldKey":"duedate",
        "jqlString":"",
        "workingTimeId":-1, // -1 for 7x24, or workingCalendarId
        "multipleTransition":true,
        "onlyFirstExecution":false,
        "pauseSlaArray":[1,5]
    }
    Possible responses
    {"success":true,"message":"34"}
    {"success":false,"message":"Failed when saving SLA: At least slaStartDateField or originStatusId should be provided"}

Bulk saving SLA definitions

MethodPOST
URL/rest/tts-api/latest/sla/bulk

Sample result:

[
  {"success":true,"message":"34"},
  {"success":false,"message":"Failed when saving SLA: At least slaStartDateField or originStatusId should be provided"}
]
  • An SLA with negotiation time and another one with custom origin and target dates 

    POST data
    [
      {
        "description":"Description of the SLA definition",
        "workflowName":"Workflow name",
        "originStatusId":[1],
        "targetStatusId":[6],
        "slaNegotiationDateIssueFieldKey":"duedate",
        "jqlString":"",
        "workingTimeId":-1, // -1 for 7x24, or workingCalendarId
        "multipleTransition":true,
        "onlyFirstExecution":false
      },
      {
        "description":"Description of the SLA definition",
        "workflowName":"Workflow name",
        "slaStartDateField":10900, // date custom field Id
        "slaEndDateField":10901,   // date custom field Id
        "slaValueAsTimeString":"3h",
        "jqlString":"",
        "workingTimeId":-1, // -1 for 7x24, or workingCalendarId
        "multipleTransition":true,
        "onlyFirstExecution":false
      }
    ]
    Possible responses
    [
      {"success":true,"message":"34"},
      {"success":false,"message":"Failed when saving SLA: At least slaStartDateField or originStatusId should be provided"}
    ]

Showing SLA definition

MethodGET
URL/rest/tts-api/latest/sla/{slaId}
Possible responses
{  
    "id": 25,
    "description":"Description of the SLA definition",
    "workflowName":"Workflow name",
    "originStatusId":[1],
    "targetStatusId":[6],
    ...
}

Searching SLA definition

MethodGET
URL/rest/tts-api/latest/sla/search
Identifiers for search operation
-descriptionExample description=Urgent
-workflowNameExample workflowName=TTS Project Workflow
-priorityIdExample priorityId=1
-originStatusIdExample originStatusId=3
-targetStatusIdExample targetStatusId=5
-slaStartDateFieldExample slaStartDateField=1
-slaEndDateFieldExample slaEndDateField=5
-multipleTransitionExample multipleTransition=true
-onlyFirstExecutionExample onlyFirstExecution=false
-slaValueAsTimeStringExample slaValueAsTimeString=20m
-slaNegotiationDateFieldIdExample slaNegotiationDateFieldId=11000
-slaNegotiationDateIssueFieldKeyExample slaNegotiationDateIssueFieldKey=duedate
-workingTimeIdExample workingTimeId=3
-jqlStringExample jqlString=issuetype = Improvement

 

 

Responses for: /rest/tts-api/latest/sla/search
[
    {
       "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
    }
]
Responses for: /rest/tts-api/latest/sla/search?description=Urgent
[
    {
       "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
    }
]
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

MethodGET
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

MethodPOST
URL/rest/tts-api/latest/sla
POST data
{  
    "id": 25,    // SLA Id
    "description":"Description of the SLA definition",
    "workflowName":"Workflow name",
    "originStatusId":[1],
    "targetStatusId":[6],
    "slaNegotiationDateIssueFieldKey":"duedate",
    "jqlString":"",
    "workingTimeId":-1, // -1 for 7x24, or workingCalendarId
    "multipleTransition":true,
    "onlyFirstExecution":false
}
Possible responses
{"success":true,"message":"25"}
{"success":false,"message":"error message!"}
Updating with pauses
{  
    "id": 25,    // SLA Id
    "description":"Description of the SLA definition",
    "workflowName":"Workflow name",
    "originStatusId":[1],
    "targetStatusId":[6],
    "slaNegotiationDateIssueFieldKey":"duedate",
    "jqlString":"",
    "workingTimeId":-1, // -1 for 7x24, or workingCalendarId
    "multipleTransition":true,
    "onlyFirstExecution":false,
    "pauseSlaArray":[5,100]
}
Possible responses
{"success":true,"message":"25"}
{"success":false,"message":"Status validation error. [100] no such status."}

 

Deleting SLA definition

MethodDELETE
URL/rest/tts-api/latest/sla/{slaId}
Possible responses
{"success":true,"message":"Deleted slaId with 25"}

Get SLA Details of an issue

MethodGET
URL/rest/tts-api/1.0/sla/issue/{issue-key}
Possible query parameters
-slaIdExample slaId=26
Error response
{"message":"Issue with given key "TTS-235" could not be found."}
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"
}
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

MethodGET
URL/rest/tts-api/1.0/sla/issue/
Possible query parameters
-slaId[Optional] sla filtering parameter Example slaId=26
-jqlJql to filter issues that you want to get SLA details. Example jql=key in (ABC-34,ABC-35)
-indexthe index of a result whose page you want the pager to start at
-maxthe maximum number of results in a page (cannot be greater than 100)

Response

For performance and memory issues, we support pagination. Max 100 issues are returned for a single page, but you can navigate with the parameters returned from REST.

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 of the issue

MethodGET
URL/rest/tts-api/1.0/sla/timeToSla/{issue-key}
Possible responses
success":false,"message":"Issue not exists: TTS-313"}
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 of the issue

MethodGET
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

MethodGET
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

MethodPOST
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)

{issue-id} required parameter where {sla-id} is optional. If {sla-id} is not provided, than all SLAs for the issue will be reset

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"}

Deleting calendar

MethodPOST
URL/rest/tts-api/latest/calendar/{id}

{id} is the ID parameter of the calendar to be deleted

Possible responses
{"success":true,"message":""}

Deleting non-working day

MethodPOST
URL/rest/tts-api/latest/calendar/nonworkingday/{id}
Possible responses
{"success":true,"message":""}
  • No labels