Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,298,600
Community Members
 
Community Events
165
Community Groups

API Request for SLA Creation 400 error

Deleted user Aug 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 Feb 08, 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
Community showcase
Published in Jira Service Management

Coming Soon: Insight Changing to Assets

The 2020 acquisition of Mindville added powerful asset and configuration management capabilities to Jira Service Management in the form of Insight. Following the completion of that integration, custo...

299 views 2 9
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you