Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal


  • Give kudos
  • Received
  • Given


  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

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

Issue with ajax request

GrBr I'm New Here Oct 19, 2020


I am currently learning to code for Confluence and I am hitting a bit of a wall that nobody can help me with, so here I am. I am trying to do a simple Ajax request to get a piece of information from our API, and I know my URL works (Postman validated), but nothing comes out of the request, as if it never went into the "done" part.

function getTestVersionText(templateData) {
var final_value;
var myurl="url_that_works"

dataType: 'json',
url: myurl,
async: false
}).done(function () {
final_value = response.issues[0].key;
}).error(function (xhr, status, error) {
return final_value;

  Anything that jumps to your eyes as to why this wouldn't work ? If I make the function just return a value directly it shows on the page, so the xml and mapping xml/js page are ok.

Thank you

1 answer

You were missing a reference to response for a start.

Try something like this:

function getTestVersionText () {

var yourUrl = "/some/path/that/works"

url: yourUrl,
type: "GET",
dataType: "json",
success: function (response) {
// callback here
console.log('success', response);
error: function (xhr, status, error) {
// callback here
console.error('error', { xhr, status, error });
// do not return here - use the callback functions success/error

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Confluence

Announcing Team Calendars in Confluence Data Center

Hi Community! We're thrilled to share that Team Calendars for Confluence is now a built-in feature for Confluence Data Center releases 7.11 and beyond.  A long time favorite,  Team Cale...

113 views 0 3
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