Top Menu

Jump to content
Home
    Modules
      • Projects
      • Activity
      • Work packages
      • Gantt charts
      • Calendars
      • Team planners
      • Boards
      • News
    • 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

      Google

Side Menu

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

Content

General discussion
  1. OpenProject
  2. Forums
  3. General discussion
  4. API - 4.2 - Create a work package in a project

API - 4.2 - Create a work package in a project

Added by Nicolas Vaissaud almost 10 years ago

Hello,

I would like to use your API to create a work package and assign it to a project member.

Therefore, my plan is to:

  1. Get all my project ids (V2 ok api/v2/projects.json?key=MYKEY / V3 NOK ?)
  2. Get all project members ids (is it possible ? i only get the responsible id in V2 api/v2/projects/12.json?key=MYKEY)
  3. Create a new work package and assign it to one of the member (looks like you only can update one, no creation endpoint yet ?)

Thank you for your help.

Regards,


Replies (1)

RE: API - 4.2 - Create a work package in a project - Added by Jan Sandbrink almost 10 years ago

APIv2 is able to update and create work packages.

Determining possible assignees is not supported via APIv2, though.

All development efforts go into APIv3, so I’d advise you to use this one as much as possible.

Since OP 4.2 the APIv3 can also create work packages. APIv3 will also tell you who is a possible assignee/responsible. However, as of now APIv3 can’t give you a list of projects/work packages.

Our documentation on APIv3 can be found here: https://www.openproject.org/api/
The documentation for APIv2 here: https://github.com/opf/openproject/blob/dev/doc/apiv2-documentation.md

The interesting endpoints in APIv3 are:

  • /api/v3/projects/{id}/work_packages
  • /api/v3/projects/{id}/available_assignees (refered to as /api/v3/projects/{id}/work_packages/available_assignees in the docs… not sure why there is a difference)

A note regarding APIv3: It might still be subject to change, but it is a hypermedia API. Therefore changing endpoint URLs don’t have to be a hazzle as long as you try to hardcode as few URLs as possible, but instead “follow” the links in the API responses.

E.g. you do not need to hardcode /api/v3/projects/{id}/available_assignees in your client, but instead you can use whatever URL you are pointed to in the corresponding form (e.g. in JSON-Path: _embedded/schema/assignee/allowedValues).

I hope that I could help you.

Best regards
Jan Sandbrink

  • (1 - 1/1)
Loading...