OpenProject icon

OpenProject

Consume OpenProject API

Overview

This node integrates with the OpenProject API to manage time entries associated with work packages. Specifically, the Time Entry - Create operation allows users to log time spent on a particular work package by specifying hours worked and the activity type. This is useful for project management scenarios where tracking time against tasks or activities is essential for billing, reporting, or productivity analysis.

Practical examples include:

  • Logging billable hours spent on a task within a project.
  • Recording time spent on different activities (e.g., development, testing) for accurate resource allocation.
  • Adding comments or specifying the date when the time was spent for detailed time tracking.

Properties

Name Meaning
Work Package ID The unique identifier of the work package to which this time entry belongs.
Hours The duration of the time entry in ISO 8601 duration format (e.g., PT1H30M for 1 hour 30 minutes).
Activity ID The identifier of the activity type related to this time entry (e.g., development, meeting).
Additional Fields Optional extra fields:
• Comment: A textual note about the time entry.
• Spent On: The date/time when the time was spent.

Output

The output JSON contains the full response from the OpenProject API after creating the time entry. This typically includes details such as the newly created time entry's ID, associated work package, hours logged, activity, comment, and timestamp information.

The node does not output binary data.

Example output structure (simplified):

{
  "id": "123",
  "hours": "PT1H30M",
  "_links": {
    "activity": {
      "href": "/api/v3/time_entries/activities/456"
    },
    "workPackage": {
      "href": "/api/v3/work_packages/789"
    }
  },
  "comment": "Worked on feature X",
  "spentOn": "2024-06-01T00:00:00Z",
  ...
}

Dependencies

  • Requires an API key credential for authenticating with the OpenProject API.
  • Needs the base URL of the OpenProject instance.
  • Uses HTTP Basic Authentication with the API key encoded in Base64.
  • Relies on the OpenProject REST API v3 endpoints.

Troubleshooting

  • Common issues:

    • Invalid or missing API key: Ensure the API key credential is correctly configured.
    • Incorrect Work Package ID or Activity ID: Verify that these IDs exist in your OpenProject instance.
    • Malformed hours format: The hours must be in ISO 8601 duration format (e.g., PT2H, PT1H30M).
    • Network or connectivity problems with the OpenProject server.
  • Error messages:

    • "OpenProject error response: <message>": Indicates an error returned by the OpenProject API. Check the message for details (e.g., invalid parameters).
    • "The resource 'timeEntry' is not supported!": Occurs if the resource parameter is incorrect.
    • "The method 'POST' is not supported!": Should not occur for create operation but indicates an unsupported HTTP method.

To resolve errors, verify all input parameters, ensure proper authentication, and confirm the OpenProject API endpoint is reachable.

Links and References

Discussion