Content
Create Work Packages via API From Spreadsheet
Added by Brett Cumings almost 8 years ago
Hi,
I am trying to write a script in Google Sheets that will (at some point) push Work Packages from rows within my spreadsheet into OpenProject. I unfortunately have little coding experience and am not sure what I’m missing here. Using the below I am getting an error that I am missing a subject and type, and that my type is not correct. I have these fields included in my payload though… Am I missing something here?
Thanks for any help!
function myFunction() {
var url = ‘https://domain.openproject.com/api/v3/projects/project-template/work_packages’;
var options = {
method,
content-type,
headers
authorization XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX="
},
“_links”: {
type
href,
title
},
status
href,
title
},
priority
href,
title
}
},
subject Import Test Case“,
”description“:{
”format“:”textile“,
”raw“:”I imported a test case!"
},
customField13
href Value“,
”title“:”Custom Value"
},
customField14
href Value“,
”title“:”Custom Value"
},
muteHttpExceptions
}
var response = UrlFetchApp.fetch(url, options) ;
Logger.log(response);
}