Post a http request to jira API

Błażej O_
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.
June 19, 2015

I want to automate creating filters in Jira, therefore I've tried creating a filter through JIRA API

I'm using this POST method:

https://docs.atlassian.com/jira/REST/6.1.7/#d2e1822

However no matter what I do I keep getting http 415 error - unsupported media type.

I have tried setting headers to accept:applicationc/json.

I have also tried empty headers_array, I have tried headers_array= "Accept|text/plain" . No matter what I do I still get 415 error.

I have tried calling it through SIL script and fiddler.

Even pasting directly the content from the API documentation gives me 415 error:

{
    "name": "All Open Bugs",
    "description": "Lists all open bugs",
    "jql": "type = Bug and resolution is empty",
    "favourite": true
}

 

Any suggestions what might be wrong?

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Answer accepted
Matheus Fernandes
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 19, 2015

Are you using the following header?

'Content-Type: application/json'
Błażej O_
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.
June 19, 2015

That helped :) I've been using "Accept: application/json"... Thanks! :)

TAGS
AUG Leaders

Atlassian Community Events