Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Garconis/f7b23ef3d7f1eef3c6adbba588a54d7e to your computer and use it in GitHub Desktop.
Save Garconis/f7b23ef3d7f1eef3c6adbba588a54d7e to your computer and use it in GitHub Desktop.
Asana | Create a Status Update to the Project/Portfolio item
// this is wrapped in an `async` function
// you can use await throughout the function
// https://developers.asana.com/reference/createstatusforobject
// get parentID (the ID of the unique project)
var parentID = inputData.parentID;
let body = {
"data": {
// "title": "test", // if no custom title is supplied, we can omit this and it uses default of "Status Update - Month Day"
"text": "This site is live and the project is considered complete",
"status_type": "complete",
"parent": parentID
}
};
// create the task based on the body and data
const res = await fetch('https://app.asana.com/api/1.0/status_updates', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer 0/XXXXXX'
},
body: JSON.stringify(body)
});
const data = await res.json();
output = { data: data }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment