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. Can't patch a workPackage via API - OpenProject 5.0.4 (Mysql2)

Can't patch a workPackage via API - OpenProject 5.0.4 (Mysql2)

Added by Danilo Petrone over 7 years ago

Hi, I’m trying to patch a WorkPackage, adding a relation to it.
Even if I run /api/v3/relations/schema/follows, as written on documentation, I get a 404.


Replies (4)

RE: Can't patch a workPackage via API - OpenProject 5.0.4 (Mysql2) - Added by Oliver Günther over 7 years ago

As "documented in the API:http://docs.openproject.org/apiv3-doc/#work-packages-relations-post, you POST to POST/api/v3/work_packages/<WP ID>/relations using the following body:

{
    "_links":
    {
        "from": { "href": "/api/v3/work_packages/<WP ID>" },
        "to": { "href": "/api/v3/work_packages/<To ID>" }
    }
    "type": "precedes",
    "description": "Relation description, optional."
}

This would create a precedes relation for your current WP, which is identical to creating a follows relation for the <To ID>.

RE: Can't patch a workPackage via API - OpenProject 5.0.4 (Mysql2) - Added by Danilo Petrone over 7 years ago

Hi, thank you for the quick response, but I get a 500 response code,
while if I run, as an example:

https://openproject.sunto.reply.it/api/v3/projects/24/work_packages?offset=1&pageSize=500&filters=[{customField14,
I get the expected response.

RE: Can't patch a workPackage via API - OpenProject 5.0.4 (Mysql2) - Added by Oliver Günther over 7 years ago

Hi Danilo,

what does the log output?

Also judging from your title, you are using OpenProject 5.0.4? Please note that the examples shown are for the stable version 7.2.x.

Best,
Oliver

RE: Can't patch a workPackage via API - OpenProject 5.0.4 (Mysql2) - Added by Danilo Petrone over 7 years ago

Hi,
I’m not able to retrieve the log right now.
Yes, I do use 5.0.4 version. Can you point me the correct documentation, so that I can find some kind of workaround achieve the same behaviour?
Thank you

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