Forums

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

Feign Exception UnsupportedMediaType during POST call to Jira rest endpoint

Bradley Willis
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 15, 2022

I have been trying to programmatically create version for a Jira project using Spring Cloud Feign.

I am following https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-project-versions/#api-rest-api-2-version-post

I am able to successfully execute the POST call via Postman, with request payload like :

  {
        "name": "ABC 2022.01.000",
        "archived": false,
        "released": true,
        "projectId": 30500
    }

However, when I try to create it through the feign client I get below exception :

Caused by: feign.FeignException$UnsupportedMediaType: [415] during [POST] to [https://jira.abc.com/rest/api/2/version] [JiraFeignClient#createVersion(VersionDTO)]: []

My feign client method:

@PostMapping(value = "/rest/api/2/version")
ResponseEntity<Object> createVersion(@RequestBody VersionDTO versionDTO);

VersionDTO.java :

@NoArgsConstructor
@AllArgsConstructor
@Builder
@ToString
@Getter
@Setter
public class VersionDTO {

    private String name;

    private Boolean archived;

    private Boolean released;
    
    private Long projectId;
}

Not sure what's wrong with my DTO. Any guidance is appreciated.

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events