Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to create a service request using POST request using REST API

Jayanth
Contributor
March 14, 2025

I need a well-structured payload for making a POST request via the REST API to create a service request in Jira Service Management (JSM) Cloud using Groovy script.

When I try to send, I always get 415 as response. Here is my payload

 

def payload = [
                        requestTypeId: requestTypeId,
                        serviceDeskId: serviceDeskId,
                        requestFieldValues: [
                            summary: summary,
                            description: description,
                            customfield_xxxx: url,
                            priority: [
                                name: "Urgent"
                            ]
                        ]
                    ]
here requestTypeId, serviceDeskId, summary, description and url are variables which are declared properly. I used to send the payload as JSON string

2 answers

0 votes
Marc - Devoteam
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 14, 2025

Hi @Jayanth 

Looking at you payload and the API documentation you need to use { and } not [ and ]

See, api-rest-servicedeskapi-request-post 

0 votes
Dirk Ronsmans
Community Champion
March 14, 2025

@Jayanth ,

HTTP 415 is unsupported media type. When you post your request do you also set your content type?

That should be application/json

 

Jayanth
Contributor
March 14, 2025

Yes, I have set the Content-type as application/json. But still get this code

Suggest an answer

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

Atlassian Community Events