Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

API Request for SLA Creation 400 error

Deleted user August 25, 2020

Hi Team,

 

I have to create some 100 SLA's and instead of doing it manually, I am looking for some API which can speed up the process.

I have created metrics/calendar and all basic structure but the below request is getting failed, can someone point the error.

curl -v --request PUT \
> --url "https://URL/rest/servicedesk/1/servicedesk/agent/Projectname/sla/metrics/41" \
> --user "username:passwordtoken" \
> --header "Accept: application/json" \
> --header "Content-Type: application/json" \
> -data '{
>     "config": {
>      "definition": {
>            "start": [
>                {
>                    "pluginKey": "com.atlassian.servicedesk",
>                    "factoryKey": "issue-created-sla-condition-factory",
>                    "conditionId": "10038",
>                    "type": "Start",
>                    "name": "Entered Status: New",
>                    "missing": false
>                }
>            ],
>            "pause": [
>                {
>                    "pluginKey": "com.atlassian.servicedesk",
>                    "factoryKey": "status-sla-condition-factory",
>                    "conditionId": "10002",
>                    "type": "Pause",
>                    "name": "Status: Waiting for Customer",
>                    "missing": false
>                }
>            ],
>            "stop": [
>                {
>                    "pluginKey": "com.atlassian.servicedesk",
>                    "factoryKey": "resolution-sla-condition-factory",
>                    "conditionId": "10028",
>                    "type": "Stop",
>                    "name": "Entered Status: Pending Closure",
>                    "missing": false
>                }
>            ],
>            "inconsistent": false
>        },
>       "goals": [
>             {
>                 "jqlQuery": "Request Type" = "P3-Medium (BO)",
>                 "duration": 14400000,
>                 "calendarId": "16",
>                 "defaultGoal": false
>             },
>            
>          {
>                "jqlQuery": "",
>                "defaultGoal": true
>            }
>       ]
>     }
>
> }' \

 

* upload completely sent off: 3 out of 3 bytes
< HTTP/1.1 400
< Server: AtlassianProxy/1.15.8.1
< Cache-Control: no-cache, no-store, no-transform
< Content-Type: application/json;charset=UTF-8
< Strict-Transport-Security: max-age=315360000; includeSubDomains; preload
< Date: Tue, 25 Aug 2020 20:35:51 GMT
< ATL-TraceId: 5e398879cc0f381d
< X-AREQUESTID: 84ed1ad5-79e9-46fb-8444-733a5c7c65a5
< X-AACCOUNTID: 5e5cc5f1052b790c975221ac
< X-XSS-Protection: 1; mode=block
< Transfer-Encoding: chunked
< Timing-Allow-Origin: *
< X-Content-Type-Options: nosniff
< Micros-Issuer: micros/edge-authenticator
< Connection: close
< Set-Cookie: atlassian.xsrf.token=caf8856b-3ecd-4db2-bf73-2f2d34ab4f4f_64bbc0afba9a65e9d6d0e1448411510ec9017abe_lin; Path=/; Secure
< Expect-CT: report-uri="https://web-security-reports.services.atlassian.com/expect-ct-report/global-proxy", enforce, max-age=86400
<
* Closing connection 0
{"errorMessages":["Unexpected character ('a' (code 97)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')\n at [Source: org.apache.catalina.connector.CoyoteInputStream@11f8ed5c; line: 1, column: 2]"]}curl: (3) [globbing] nested braces not supported at pos 19

1 answer

0 votes
Dario B
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 8, 2022

A bit too late, but the error here seems to be caused by the fact that you are using:

-data

instead of:

--data

 in your curl request.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events