Save the task gid when posting a new task by Google App Script

Hi,

I am new on app script and API’s.
Actually i could be able to create a new task on a specific project on Asana throught Google Apss script.
Now i want to know how can i save the task gid that i create in a variable to save the date in a google spreadsheet and acces later.

I am using this script

PERSONAL_ACCESS_TOKEN = “xxxx”;
WORKSPACE_ID = “xxx”;
ASSIGNEE =Session.getActiveUser().getEmail();

function Asana(taskName,Notes) {
var newTask = {
name: taskName,
workspace: WORKSPACE_ID,
projects: “xxx”,
assignee: ASSIGNEE,
notes: Notes
};
createAsanaTask(newTask);
};
function createAsanaTask(task) {
if (task.workspace == null) {
task.workspace=WORKSPACE_ID
}
if (task.assignee == null) {
task.assignee=“me”;
}

var options = {
“method”: “POST”,
“headers”: {
“Accept”: “application/json”,
“Content-Type”: “application/json”,
“Authorization”: "Bearer " + PERSONAL_ACCESS_TOKEN
},
“payload”: JSON.stringify({data: task})
};
try {
var url = “https://app.asana.com/api/1.0/tasks”;
var result = UrlFetchApp.fetch(url, options);
var taskJSON = result.getContentText();
} catch (e) {
Logger.log(e);
return null;
} finally {
return JSON.parse(taskJSON).data;
}
};