I am trying to build a jira plugin which involves Jira Rest API by using Java and Unirest library.
I have a working Java program on my local computer, which successfully calls the Jira Rest APIs and creates a Issue.
However, I am running into errors on create issue api call.
This is how I am calling the create issue API on both my local program and the plugin where api_url, payload, and authentication are all identical., The local program yields a 201 response, while my plugin gives a 500 response.
HttpResponse<JsonNode> createIssueResponse = Unirest.post(api_url+"issue")
.withObjectMapper(new JacksonObjectMapper())
.basicAuth(username, password)
.header("Accept", "application/json")
.header("Content-Type", "application/json")
.body(payload)
.asJson();
public static String username = "admin";
public static String password = "admin";
public static String api_url = "http://localhost:2990/jira/rest/api/latest/";
Payload is
{"fields":{"summary":"Test case of PLAT-2","issuetype":{"id":"10000"},"priority":{"id":"3"},"project":{"key":"PLAT"},"assignee":{"name":"admin"}}}
Side Note:
When I try to call Get Issue API, the plugin runs successfully, so it shouldn't be a problem with my authentication. However, I am using the exact same body as well, so I am really confused on what is actually causing the error.
Thanks
Problem solved:
All I did was running atlas-mvn clean and atlas-mvn package. Somehow magically, I no longer get the same error response as I reconfigured the target files for my jira software.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.