Top Menu

Jump to content
    Modules
      • Projects
      • Activity
      • Work packages
      • Gantt charts
      • Calendars
      • Team planners
      • Boards
      • News
    Home
    • Getting started
    • Introduction video
      Welcome to OpenProject Community
      Get a quick overview of project management and team collaboration with OpenProject. You can restart this video from the help menu.

    • Help and support
    • Upgrade to Enterprise edition
    • User guides
    • Videos
    • Shortcuts
    • Community forum
    • Enterprise support

    • Additional resources
    • Data privacy and security policy
    • Digital accessibility (DE)
    • OpenProject website
    • Security alerts / Newsletter
    • OpenProject blog
    • Release notes
    • Report a bug
    • Development roadmap
    • Add and edit translations
    • API documentation
  • Sign in
      Forgot your password?

      or sign in with your existing account

      OpenProject ID Google

Side Menu

Collapse project menu

  • Overview
  • Activity
    Activity
  • Roadmap
  • Work packages
    Work packages
  • Gantt charts
    Gantt charts
  • Calendars
    Calendars
  • Team planners
    Team planners
  • Boards
    Boards
  • News
  • Forums

Content

Expand project menu
Development
  1. OpenProject Community
  2. OpenProject
  3. Forums
  4. Development
  5. Create Work Packages via API From Spreadsheet

Create Work Packages via API From Spreadsheet

Added by Brett Cumings over 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);
}


Loading...