Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

My basic POC of Jira issue builder is throwing an exception. Help. Is there a version mismatch?

My code throws an exception where it is expecting JSON but has XML.  I'm wondering if there is a version mismatch.   Is there a way to determine if my API matches the version of Jira I have on the server?

public String createIssue(IssueInputBuilder builder) {

IssueRestClient issueClient = this.jiraRestClient.getIssueClient();
IssueInput issueInput = builder.build();
Promise<BasicIssue> pbi = issueClient.createIssue(issueInput);
BasicIssue issue = pbi.claim();
String issueKey = issue.getKey();
return issueKey;

}

 Caused by: com.atlassian.jira.rest.client.api.RestClientException: org.codehaus.jettison.json.JSONException: A JSONObject text must begin with '{' at character 1 of <!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><title>Oops, you&#39;ve found a dead link. - JIRA</title><script type="text/javascript">contextPath = "";</script><link type='text/css' rel='stylesheet' href='/static-assets/metal-all.css' media='all'><script src='/static-assets/jquery-min.js'></script><script src='/static-assets/metal-all.js'></script><meta name="decorator" content="none" /></head><body class=" error-page error404"><script type="text/javascript">document.body.className += " js-enabled";</script><div id="page"><header id="header" role="banner" aria-label="Site"></header><div id="content"><div class="aui-page-panel" ><div class="aui-page-panel-inner"><main role="main" id="main" class="aui-page-panel-content lowerContent" ><div id="error-state"><span class="error-type"></span><h1>Oops, you&#39;ve found a dead link.</h1><ul><li>Go back to the <a href="javascript&colon;window.history.back()">previous page</a></li><li>Go to the <a href="/secure/MyJiraHome.jspa">Home Page</a></li></ul></div></main></div></div></div><footer id="footer" role="contentinfo"><section class="footer-body"><ul class="atlassian-footer">
<li>
Atlassian Jira <a class="seo-link" rel="nofollow" href="https://www.atlassian.com/software/jira">Project Management Software</a>
<span id="footer-build-information">(v8.13.1#813001-<span title='1f8e8da6e646fc554825c028f5305ba1b558f740' data-commit-id='1f8e8da6e646fc554825c028f5305ba1b558f740}'>sha1:1f8e8da</span>)</span>

1 answer

0 votes

Hi! 

Don't forget about the next headers :) 

{"Content-Type": "application/json", "Accept": "application/json"}

I hope it helps

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase

The benefits of using Jira in different departments

Jira is a great tool to use across different departments. Forget that paperwork – switch to Jira and get that tasks done smoothly. Marketing Jira allows for a complete digital transformation of you...

101 views 0 6
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